1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-02 15:14:08 +03:00

feat(python tcp server): map speech synthesis hardware device choice to settings

This commit is contained in:
louistiti 2024-06-30 16:54:59 +08:00
parent a05f34422e
commit 8eeff3a01c
No known key found for this signature in database
GPG Key ID: 92CD6A2E497E1669
3 changed files with 4 additions and 2 deletions

View File

@ -4,7 +4,8 @@
"device": "auto" "device": "auto"
}, },
"tts": { "tts": {
"model_file_name": "EN-Leon-V1_1-G_600000.pth" "model_file_name": "EN-Leon-V1_1-G_600000.pth",
"device": "auto"
}, },
"wake_word": {} "wake_word": {}
} }

View File

@ -58,7 +58,7 @@ class TCPServer:
return return
self.tts = TTS(language='EN', self.tts = TTS(language='EN',
device='cpu', device=get_settings('tts')['device'],
config_path=TTS_MODEL_CONFIG_PATH, config_path=TTS_MODEL_CONFIG_PATH,
ckpt_path=TTS_MODEL_PATH ckpt_path=TTS_MODEL_PATH
) )

View File

@ -18,6 +18,7 @@ from ..utils import is_macos
class TTS(nn.Module): class TTS(nn.Module):
def __init__(self, def __init__(self,
language, language,
# auto, cpu, cuda, mps
device='auto', device='auto',
use_hf=True, use_hf=True,
config_path=None, config_path=None,