Restore old router Base TTS with identical preset voice embeddings
This commit is contained in:
1 parent
08e9d69424
commit
0d2f441dae
10 files changed
+110
-8
No files matched your search
+6
-5
@@ -1,10 +1,10 @@
|
||||
"""Own CUDA environment and pinned official CustomVoice model, installable via GUI."""
|
||||
"""Own CUDA environment and pinned Base model with the old router's preset voices."""
|
||||
import json,sys,time,os,uuid,shutil,threading,hashlib,subprocess
|
||||
from pathlib import Path
|
||||
from image_runtime import ImageRuntime
|
||||
FAST_VERSION='0.3.0'
|
||||
REPO='Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice'
|
||||
REVISION='0c0e3051f131929182e2c023b9537f8b1c68adfe'
|
||||
REPO='Qwen/Qwen3-TTS-12Hz-1.7B-Base'
|
||||
REVISION='fd4b254389122332181a7c3db7f27e918eec64e3'
|
||||
SPEAKERS=['Vivian','Serena','Uncle_Fu','Dylan','Eric','Ryan','Aiden','Ono_Anna','Sohee']
|
||||
LANGUAGES=['Auto','German','English','Chinese','Japanese','Korean','French','Russian','Portuguese','Spanish','Italian']
|
||||
class TTSRuntime(ImageRuntime):
|
||||
@@ -32,7 +32,8 @@ class TTSRuntime(ImageRuntime):
|
||||
def status(self):
|
||||
with self.lock:
|
||||
python,model=self.paths()
|
||||
return dict(installed=python.is_file() and (model/'ready').exists(),job=dict(self.job) if self.job else None,backend='faster-qwen3-tts',backend_version=FAST_VERSION,backend_ready=(model.parent/'fast-backend.version').is_file() and (model.parent/'fast-backend.version').read_text()==FAST_VERSION,repo=REPO,revision=REVISION,speakers=SPEAKERS,languages=LANGUAGES)
|
||||
installed=python.is_file() and (model/'ready').is_file() and (model/'ready').read_text().strip()==REVISION
|
||||
return dict(installed=installed,job=dict(self.job) if self.job else None,backend='faster-qwen3-tts',backend_version=FAST_VERSION,backend_ready=(model.parent/'fast-backend.version').is_file() and (model.parent/'fast-backend.version').read_text()==FAST_VERSION,repo=REPO,revision=REVISION,speakers=SPEAKERS,languages=LANGUAGES)
|
||||
def ensure_library(self):
|
||||
if not self.status()['installed']:raise ValueError('Zuerst TTS einrichten.')
|
||||
_,model=self.paths();ident=hashlib.sha256((REPO+REVISION+'model.safetensors').encode()).hexdigest();target=self.root.parent/'models'/ident;target.mkdir(parents=True,exist_ok=True,mode=0o700)
|
||||
@@ -72,7 +73,7 @@ class TTSRuntime(ImageRuntime):
|
||||
(base/'fast-backend.version').write_text(FAST_VERSION)
|
||||
marker=self.root/'active.tmp';marker.write_text(json.dumps(dict(id=base.name)));marker.replace(self.root/'active.json')
|
||||
self.ensure_library()
|
||||
state='complete';phase='TTS bereit · CUDA-Modell mit eingebauten Stimmen installiert'
|
||||
state='complete';phase='TTS bereit · Base-Modell mit Preset-Stimmen installiert'
|
||||
except InterruptedError:state='cancelled';phase='TTS-Einrichtung abgebrochen'
|
||||
except Exception as exc:phase=str(exc) if isinstance(exc,RuntimeError) else 'TTS-Einrichtung fehlgeschlagen. Speicher und Internetverbindung prüfen.'
|
||||
finally:
|
||||
|
||||
Reference in new issue
Block a user