Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -125,7 +125,7 @@ def infer(audio_input_path):
|
|
125 |
if result.returncode == 0:
|
126 |
print("Command executed successfully.")
|
127 |
concat_out, file_list = concatenate_audio()
|
128 |
-
return concat_out, gr.update(choices=file_list, value=file_list[0], visible=True), gr.update(visible=True), gr.update(value=file_list, visible=True), gr.update(visible=True)
|
129 |
else:
|
130 |
print("Error executing command.")
|
131 |
raise gr.Error("Error executing command")
|
@@ -254,7 +254,7 @@ with gr.Blocks(css=css) as demo:
|
|
254 |
gr.Markdown("This is a simple demo for Kyutai's Hibiki translation models • Currently supports French to English only.")
|
255 |
video_input = gr.Video(label="Video IN")
|
256 |
audio_input = gr.Audio(label="Audio IN", type="filepath")
|
257 |
-
submit_btn = gr.Button("
|
258 |
output_result = gr.Audio(label="Translated result")
|
259 |
|
260 |
with gr.Row():
|
@@ -264,12 +264,12 @@ with gr.Blocks(css=css) as demo:
|
|
264 |
visible=False,
|
265 |
scale=2
|
266 |
)
|
267 |
-
choose_this_btn = gr.Button("
|
268 |
with gr.Row():
|
269 |
volume_reduction = gr.Slider(label="Volume reduction", minimum=0, maximum=60, step=1, value=30, visible=False)
|
270 |
cut_start = gr.Slider(label="Cut start", minimum=0.0, maximum=4.0, step=0.1, value=2.0, visible=False)
|
271 |
combined_output = gr.Audio("Combined Output", type="filepath", visible=False)
|
272 |
-
apply_to_video_btn = gr.Button("Apply to video", visible=False)
|
273 |
final_video_out = gr.Video(label="Video + Translated Audio", visible=False)
|
274 |
with gr.Accordion("Downloadable audio Output list", open=False, visible=False) as result_accordion:
|
275 |
wav_list = gr.Files(label="Output Audio List", visible=False)
|
@@ -321,7 +321,7 @@ with gr.Blocks(css=css) as demo:
|
|
321 |
).then(
|
322 |
fn = infer,
|
323 |
inputs = [audio_input],
|
324 |
-
outputs = [output_result, dropdown_wav_selector, result_accordion, wav_list, choose_this_btn]
|
325 |
)
|
326 |
|
327 |
demo.queue().launch(show_api=False, show_error=True)
|
|
|
125 |
if result.returncode == 0:
|
126 |
print("Command executed successfully.")
|
127 |
concat_out, file_list = concatenate_audio()
|
128 |
+
return concat_out, gr.update(choices=file_list, value=file_list[0], visible=True), gr.update(visible=True), gr.update(value=file_list, visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
129 |
else:
|
130 |
print("Error executing command.")
|
131 |
raise gr.Error("Error executing command")
|
|
|
254 |
gr.Markdown("This is a simple demo for Kyutai's Hibiki translation models • Currently supports French to English only.")
|
255 |
video_input = gr.Video(label="Video IN")
|
256 |
audio_input = gr.Audio(label="Audio IN", type="filepath")
|
257 |
+
submit_btn = gr.Button("Generate translations")
|
258 |
output_result = gr.Audio(label="Translated result")
|
259 |
|
260 |
with gr.Row():
|
|
|
264 |
visible=False,
|
265 |
scale=2
|
266 |
)
|
267 |
+
choose_this_btn = gr.Button("Apply this one as translated overlay", scale=1, visible=False)
|
268 |
with gr.Row():
|
269 |
volume_reduction = gr.Slider(label="Volume reduction", minimum=0, maximum=60, step=1, value=30, visible=False)
|
270 |
cut_start = gr.Slider(label="Cut start", minimum=0.0, maximum=4.0, step=0.1, value=2.0, visible=False)
|
271 |
combined_output = gr.Audio("Combined Output", type="filepath", visible=False)
|
272 |
+
apply_to_video_btn = gr.Button("Apply to your video", visible=False)
|
273 |
final_video_out = gr.Video(label="Video + Translated Audio", visible=False)
|
274 |
with gr.Accordion("Downloadable audio Output list", open=False, visible=False) as result_accordion:
|
275 |
wav_list = gr.Files(label="Output Audio List", visible=False)
|
|
|
321 |
).then(
|
322 |
fn = infer,
|
323 |
inputs = [audio_input],
|
324 |
+
outputs = [output_result, dropdown_wav_selector, result_accordion, wav_list, choose_this_btn, volume_reduction, cut_start]
|
325 |
)
|
326 |
|
327 |
demo.queue().launch(show_api=False, show_error=True)
|