Spaces:
r3gm
/
Running

r3gm commited on
Commit
781af3d
1 Parent(s): f17b91a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1746,7 +1746,10 @@ def change_choices_fix():
1746
  'aiff', 'webm', 'ac3')):
1747
  audio_paths.append(os.path.join('./audios',filename).replace('\\', '/'))
1748
  print(audio_paths)
1749
- return {"choices": sorted(audio_paths), "__type__": "update"}
 
 
 
1750
 
1751
 
1752
  def custom_voice(
 
1746
  'aiff', 'webm', 'ac3')):
1747
  audio_paths.append(os.path.join('./audios',filename).replace('\\', '/'))
1748
  print(audio_paths)
1749
+ most_recent_audio = ""
1750
+ if audio_paths:
1751
+ most_recent_audio = max(audio_paths, key=os.path.getctime)
1752
+ return {"choices": sorted(audio_paths), "value": most_recent_audio, "__type__": "update"}
1753
 
1754
 
1755
  def custom_voice(