akshansh36 commited on
Commit
eb5e00e
1 Parent(s): 19d26a2

added playback for processed audio

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -1,5 +1,3 @@
1
-
2
-
3
  import os
4
  import gradio as gr
5
  import spaces
@@ -257,15 +255,13 @@ def run(audio_files, file_m, file_index):
257
 
258
 
259
  def process_audio(audio_files, file_m, file_index):
260
-
261
- yield [], gr.update(visible=False)
262
  result, first_audio = run(audio_files, file_m, file_index)
263
 
264
  # Ensure first_audio is correctly formatted as a valid file path
265
  if not os.path.exists(first_audio):
266
  raise ValueError(f"Processed audio file not found at: {first_audio}")
267
 
268
- yield result, gr.update(value=first_audio, visible=True)
269
 
270
 
271
  def model_conf():
@@ -301,7 +297,7 @@ def button_conf():
301
  )
302
 
303
  def output_conf():
304
- return gr.File(label="Result", file_count="multiple", interactive=False), gr.Audio(label="Play Result",visible=False,show_share_button=False,show_download_button=False)
305
 
306
  def get_gui(theme):
307
  with gr.Blocks(theme=theme, delete_cache=(3200, 3200)) as app:
 
 
 
1
  import os
2
  import gradio as gr
3
  import spaces
 
255
 
256
 
257
  def process_audio(audio_files, file_m, file_index):
 
 
258
  result, first_audio = run(audio_files, file_m, file_index)
259
 
260
  # Ensure first_audio is correctly formatted as a valid file path
261
  if not os.path.exists(first_audio):
262
  raise ValueError(f"Processed audio file not found at: {first_audio}")
263
 
264
+ return result, gr.update(value=first_audio, visible=True)
265
 
266
 
267
  def model_conf():
 
297
  )
298
 
299
  def output_conf():
300
+ return gr.File(label="Result", file_count="multiple", interactive=False), gr.Audio(label="Play Result",visible=False,show_share_button=False)
301
 
302
  def get_gui(theme):
303
  with gr.Blocks(theme=theme, delete_cache=(3200, 3200)) as app: