Spaces:
Sleeping
Sleeping
Fix syntax error in TTS stage and complete pipeline
Browse files
app.py
CHANGED
|
@@ -381,6 +381,14 @@ try:
|
|
| 381 |
else:
|
| 382 |
TTS_MODEL.load_state_dict(state) # Assume the whole file is the state_dict
|
| 383 |
TTS_MODEL.eval()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
print("TTS model loaded successfully.")
|
| 385 |
except Exception as e:
|
| 386 |
print(f"Error loading TTS model: {e}")
|
|
|
|
| 381 |
else:
|
| 382 |
TTS_MODEL.load_state_dict(state) # Assume the whole file is the state_dict
|
| 383 |
TTS_MODEL.eval()
|
| 384 |
+
|
| 385 |
+
# Try torch.compile for additional speedup (PyTorch 2.0+)
|
| 386 |
+
try:
|
| 387 |
+
TTS_MODEL = torch.compile(TTS_MODEL, mode="reduce-overhead")
|
| 388 |
+
print("TTS model compiled successfully (with torch.compile).")
|
| 389 |
+
except Exception as compile_error:
|
| 390 |
+
print(f"Torch compile not available: {compile_error}, using standard model.")
|
| 391 |
+
|
| 392 |
print("TTS model loaded successfully.")
|
| 393 |
except Exception as e:
|
| 394 |
print(f"Error loading TTS model: {e}")
|