Remsky commited on
Commit
462e867
1 Parent(s): 3c8cbc9

Set default voice to 'af_sky' if available when updating voice choices

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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
- return gr.update(choices=voices, value=[voices[0]] if voices else None)
 
 
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