Update app.py
Browse files
app.py
CHANGED
|
@@ -11,10 +11,6 @@ if __name__ == "__main__":
|
|
| 11 |
logging.basicConfig(level=logging.WARNING)
|
| 12 |
|
| 13 |
|
| 14 |
-
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 15 |
-
if HF_TOKEN:
|
| 16 |
-
print("🔑 Logging in to Hugging Face Hub...")
|
| 17 |
-
login(HF_TOKEN)
|
| 18 |
|
| 19 |
from RealtimeTTS import (
|
| 20 |
TextToAudioStream,
|
|
@@ -37,24 +33,21 @@ import wave
|
|
| 37 |
import io
|
| 38 |
import os
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
| 43 |
|
| 44 |
-
ORPHEUS_API_URL = "https://huggingface.co/spaces/Tomtom84/dev-mode-realtts-orpheus/"
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
"
|
| 53 |
-
"
|
| 54 |
-
|
| 55 |
-
"kokoro",
|
| 56 |
-
"orpheus"
|
| 57 |
-
]
|
| 58 |
|
| 59 |
# change start engine by moving engine name
|
| 60 |
# to the first position in SUPPORTED_ENGINES
|
|
|
|
| 11 |
logging.basicConfig(level=logging.WARNING)
|
| 12 |
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
from RealtimeTTS import (
|
| 16 |
TextToAudioStream,
|
|
|
|
| 33 |
import io
|
| 34 |
import os
|
| 35 |
|
| 36 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 37 |
+
if HF_TOKEN:
|
| 38 |
+
print("🔑 Logging in to Hugging Face Hub...")
|
| 39 |
+
login(HF_TOKEN)
|
| 40 |
|
|
|
|
| 41 |
|
| 42 |
+
register_engine("orpheus", OrpheusEngine)
|
| 43 |
|
| 44 |
|
| 45 |
+
PORT = int(os.getenv("TTS_FASTAPI_PORT", 7860)) # Zahl kongruent halten
|
| 46 |
+
SUPPORTED_ENGINES = ["orpheus"]
|
| 47 |
+
engines["orpheus"] = OrpheusEngine(
|
| 48 |
+
api_url=os.getenv("ORPHEUS_API_URL"), # http://127.0.0.1:1234/v1/completions
|
| 49 |
+
model=os.getenv("ORPHEUS_MODEL") # Kartoffel-ID
|
| 50 |
+
)
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
# change start engine by moving engine name
|
| 53 |
# to the first position in SUPPORTED_ENGINES
|