Update app.py
Browse files
app.py
CHANGED
|
@@ -204,18 +204,31 @@ def load_tts_model(voice_style="default_female"):
|
|
| 204 |
|
| 205 |
print(f"π Loading {selected_model['description']}...")
|
| 206 |
|
|
|
|
|
|
|
| 207 |
tts = TTS(selected_model["name"]).to(DEVICE)
|
| 208 |
|
| 209 |
-
# Quick test
|
| 210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
|
| 212 |
model_loaded = True
|
| 213 |
current_model = selected_model["name"]
|
| 214 |
voice_cloning_supported = supports_voice_cloning()
|
|
|
|
|
|
|
|
|
|
| 215 |
return True
|
| 216 |
|
| 217 |
except Exception as e:
|
| 218 |
print(f"β Failed to initialize TTS: {e}")
|
|
|
|
|
|
|
| 219 |
model_loading = False
|
| 220 |
return False
|
| 221 |
finally:
|
|
|
|
| 204 |
|
| 205 |
print(f"π Loading {selected_model['description']}...")
|
| 206 |
|
| 207 |
+
# Initialize TTS with progress updates
|
| 208 |
+
print(f"π₯ Downloading model: {selected_model['name']}")
|
| 209 |
tts = TTS(selected_model["name"]).to(DEVICE)
|
| 210 |
|
| 211 |
+
# Quick test with simple text
|
| 212 |
+
print("π§ͺ Testing TTS with sample text...")
|
| 213 |
+
test_path = "/tmp/test.wav"
|
| 214 |
+
tts.tts_to_file(text="Hello", file_path=test_path)
|
| 215 |
+
|
| 216 |
+
# Clean up test file
|
| 217 |
+
if os.path.exists(test_path):
|
| 218 |
+
os.remove(test_path)
|
| 219 |
|
| 220 |
model_loaded = True
|
| 221 |
current_model = selected_model["name"]
|
| 222 |
voice_cloning_supported = supports_voice_cloning()
|
| 223 |
+
|
| 224 |
+
print(f"β
Model loaded successfully: {current_model}")
|
| 225 |
+
print(f"ποΈ Voice cloning supported: {voice_cloning_supported}")
|
| 226 |
return True
|
| 227 |
|
| 228 |
except Exception as e:
|
| 229 |
print(f"β Failed to initialize TTS: {e}")
|
| 230 |
+
import traceback
|
| 231 |
+
traceback.print_exc()
|
| 232 |
model_loading = False
|
| 233 |
return False
|
| 234 |
finally:
|