Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -255,17 +255,15 @@ def run(audio_files, file_m, file_index):
|
|
255 |
|
256 |
|
257 |
def process_audio(audio_files, file_m, file_index):
|
258 |
-
|
259 |
-
result, first_audio = run(audio_files, file_m, file_index)
|
260 |
|
261 |
# Create a list of Audio components with filenames as labels
|
262 |
audio_outputs = [
|
263 |
gr.Audio(value=audio_path, label=os.path.basename(audio_path), visible=True, show_share_button=False)
|
264 |
-
for audio_path in result
|
265 |
]
|
266 |
|
267 |
-
return
|
268 |
-
|
269 |
|
270 |
|
271 |
|
@@ -330,7 +328,11 @@ def get_gui(theme):
|
|
330 |
button_base.click(
|
331 |
process_audio,
|
332 |
inputs=[aud, model, indx],
|
333 |
-
outputs=[
|
|
|
|
|
|
|
|
|
334 |
)
|
335 |
|
336 |
gr.Examples(
|
@@ -340,7 +342,7 @@ def get_gui(theme):
|
|
340 |
],
|
341 |
fn=process_audio,
|
342 |
inputs=[aud, model, indx],
|
343 |
-
outputs=[
|
344 |
cache_examples=False,
|
345 |
)
|
346 |
|
|
|
255 |
|
256 |
|
257 |
def process_audio(audio_files, file_m, file_index):
|
258 |
+
result, first_audio = run(audio_files, file_m, file_index) # Extract the list of paths and the first path
|
|
|
259 |
|
260 |
# Create a list of Audio components with filenames as labels
|
261 |
audio_outputs = [
|
262 |
gr.Audio(value=audio_path, label=os.path.basename(audio_path), visible=True, show_share_button=False)
|
263 |
+
for audio_path in result
|
264 |
]
|
265 |
|
266 |
+
return audio_outputs, result
|
|
|
267 |
|
268 |
|
269 |
|
|
|
328 |
button_base.click(
|
329 |
process_audio,
|
330 |
inputs=[aud, model, indx],
|
331 |
+
outputs=[output_audio, output_file],
|
332 |
+
).then(
|
333 |
+
lambda audio_outputs: gr.update(visible=True),
|
334 |
+
inputs=[output_audio],
|
335 |
+
outputs=[output_audio]
|
336 |
)
|
337 |
|
338 |
gr.Examples(
|
|
|
342 |
],
|
343 |
fn=process_audio,
|
344 |
inputs=[aud, model, indx],
|
345 |
+
outputs=[output_audio, output_file],
|
346 |
cache_examples=False,
|
347 |
)
|
348 |
|