Spaces:
Runtime error
Runtime error
Set default voice to 'af_sky' if available when updating voice choices
Browse files
app.py
CHANGED
|
@@ -26,7 +26,9 @@ def initialize_model():
|
|
| 26 |
if not voices:
|
| 27 |
raise gr.Error("No voices found. Please check the voices directory.")
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
| 30 |
|
| 31 |
def update_progress(chunk_num, total_chunks, tokens_per_sec, rtf, progress_state, start_time, gpu_timeout, progress):
|
| 32 |
# Calculate time metrics
|
|
|
|
| 26 |
if not voices:
|
| 27 |
raise gr.Error("No voices found. Please check the voices directory.")
|
| 28 |
|
| 29 |
+
default_voice = 'af_sky' if 'af_sky' in voices else voices[0] if voices else None
|
| 30 |
+
|
| 31 |
+
return gr.update(choices=voices, value=default_voice)
|
| 32 |
|
| 33 |
def update_progress(chunk_num, total_chunks, tokens_per_sec, rtf, progress_state, start_time, gpu_timeout, progress):
|
| 34 |
# Calculate time metrics
|