Spaces:
Runtime error
Runtime error
Update local_server_new.py
Browse files- local_server_new.py +4 -4
local_server_new.py
CHANGED
|
@@ -37,12 +37,12 @@ app.add_middleware(
|
|
| 37 |
try:
|
| 38 |
model_dir = "/app/models/xtts_v2"
|
| 39 |
config_path = os.path.join(model_dir, "config.json")
|
| 40 |
-
tts = TTS(model_path=model_dir, config_path=config_path
|
| 41 |
-
print("XTTS v2 model loaded successfully from local files
|
| 42 |
except Exception as e:
|
| 43 |
print(f"Error loading XTTS v2 model from local files: {e}")
|
| 44 |
-
print("Falling back to loading by model name (license might be required)
|
| 45 |
-
tts = TTS("tts_models/multilingual/multi-dataset-xtts_v2"
|
| 46 |
|
| 47 |
# Load sentiment models
|
| 48 |
arabic_model_name = "aubmindlab/bert-base-arabertv02-twitter"
|
|
|
|
| 37 |
try:
|
| 38 |
model_dir = "/app/models/xtts_v2"
|
| 39 |
config_path = os.path.join(model_dir, "config.json")
|
| 40 |
+
tts = TTS(model_path=model_dir, config_path=config_path).to("cuda" if torch.cuda.is_available() else "cpu")
|
| 41 |
+
print("XTTS v2 model loaded successfully from local files.")
|
| 42 |
except Exception as e:
|
| 43 |
print(f"Error loading XTTS v2 model from local files: {e}")
|
| 44 |
+
print("Falling back to loading by model name (license might be required).")
|
| 45 |
+
tts = TTS("tts_models/multilingual/multi-dataset-xtts_v2").to("cuda" if torch.cuda.is_available() else "cpu")
|
| 46 |
|
| 47 |
# Load sentiment models
|
| 48 |
arabic_model_name = "aubmindlab/bert-base-arabertv02-twitter"
|