Update engines/orpheus_engine.py
Browse files
engines/orpheus_engine.py
CHANGED
@@ -13,8 +13,7 @@ from RealtimeTTS.engines import BaseEngine, TimingInfo
|
|
13 |
DEFAULT_API_URL = "http://127.0.0.1:1234/v1/completions"
|
14 |
DEFAULT_HEADERS = {"Content-Type": "application/json"}
|
15 |
DEFAULT_MODEL = "orpheus-3b-0.1-ft"
|
16 |
-
DEFAULT_VOICE = "
|
17 |
-
AVAILABLE_VOICES = ["tara", "leah", "jess", "leo", "dan", "mia", "zac", "zoe"]
|
18 |
SAMPLE_RATE = 24000 # Specific sample rate for Orpheus
|
19 |
|
20 |
# Special token definitions for prompt formatting and token decoding
|
@@ -337,12 +336,11 @@ class OrpheusEngine(BaseEngine):
|
|
337 |
def get_voices(self) -> list[OrpheusVoice]:
|
338 |
"""Return a list of available voices for the Kartoffel checkpoint."""
|
339 |
return self._SPEAKERS
|
340 |
-
|
341 |
-
# In set_voice() akzeptieren wir einfach den Namen:
|
342 |
def set_voice(self, voice_name: str) -> None:
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
|
347 |
def set_voice_parameters(self, **kwargs):
|
348 |
"""
|
|
|
13 |
DEFAULT_API_URL = "http://127.0.0.1:1234/v1/completions"
|
14 |
DEFAULT_HEADERS = {"Content-Type": "application/json"}
|
15 |
DEFAULT_MODEL = "orpheus-3b-0.1-ft"
|
16 |
+
DEFAULT_VOICE = "JaKob"
|
|
|
17 |
SAMPLE_RATE = 24000 # Specific sample rate for Orpheus
|
18 |
|
19 |
# Special token definitions for prompt formatting and token decoding
|
|
|
336 |
def get_voices(self) -> list[OrpheusVoice]:
|
337 |
"""Return a list of available voices for the Kartoffel checkpoint."""
|
338 |
return self._SPEAKERS
|
339 |
+
|
|
|
340 |
def set_voice(self, voice_name: str) -> None:
|
341 |
+
if voice_name not in [v.name for v in self._SPEAKERS]:
|
342 |
+
raise ValueError(f"Unknown Orpheus speaker '{voice_name}'")
|
343 |
+
self.voice = OrpheusVoice(voice_name) # <–– wichtig
|
344 |
|
345 |
def set_voice_parameters(self, **kwargs):
|
346 |
"""
|