Update app.py
Browse files
app.py
CHANGED
|
@@ -593,11 +593,11 @@ def upload_and_manage(file, target_language, mode="transcription"):
|
|
| 593 |
elapsed_time_display = f"Processing completed in {elapsed_time:.2f} seconds."
|
| 594 |
logger.info(f"Processing completed in {elapsed_time:.2f} seconds.")
|
| 595 |
|
| 596 |
-
return
|
| 597 |
|
| 598 |
except Exception as e:
|
| 599 |
logger.error(f"An error occurred: {str(e)}")
|
| 600 |
-
return
|
| 601 |
|
| 602 |
# Gradio Interface with Tabs
|
| 603 |
def build_interface():
|
|
@@ -609,7 +609,6 @@ def build_interface():
|
|
| 609 |
language_input = gr.Dropdown(["en", "es", "fr", "zh"], label="Select Language") # Language codes
|
| 610 |
process_mode = gr.Radio(choices=["Transcription", "Transcription with Voiceover"], label="Choose Processing Type", value="Transcription")
|
| 611 |
submit_button = gr.Button("Post and Process")
|
| 612 |
-
editable_translations = gr.State(value=[])
|
| 613 |
|
| 614 |
with gr.Column(scale=8):
|
| 615 |
gr.Markdown("## Edit Translations")
|
|
@@ -656,7 +655,7 @@ def build_interface():
|
|
| 656 |
submit_button.click(
|
| 657 |
upload_and_manage,
|
| 658 |
inputs=[file_input, language_input, process_mode],
|
| 659 |
-
outputs=[
|
| 660 |
)
|
| 661 |
|
| 662 |
# Connect submit button to save_feedback_db function
|
|
|
|
| 593 |
elapsed_time_display = f"Processing completed in {elapsed_time:.2f} seconds."
|
| 594 |
logger.info(f"Processing completed in {elapsed_time:.2f} seconds.")
|
| 595 |
|
| 596 |
+
return editable_table, output_video_path, elapsed_time_display
|
| 597 |
|
| 598 |
except Exception as e:
|
| 599 |
logger.error(f"An error occurred: {str(e)}")
|
| 600 |
+
return [], None, f"An error occurred: {str(e)}"
|
| 601 |
|
| 602 |
# Gradio Interface with Tabs
|
| 603 |
def build_interface():
|
|
|
|
| 609 |
language_input = gr.Dropdown(["en", "es", "fr", "zh"], label="Select Language") # Language codes
|
| 610 |
process_mode = gr.Radio(choices=["Transcription", "Transcription with Voiceover"], label="Choose Processing Type", value="Transcription")
|
| 611 |
submit_button = gr.Button("Post and Process")
|
|
|
|
| 612 |
|
| 613 |
with gr.Column(scale=8):
|
| 614 |
gr.Markdown("## Edit Translations")
|
|
|
|
| 655 |
submit_button.click(
|
| 656 |
upload_and_manage,
|
| 657 |
inputs=[file_input, language_input, process_mode],
|
| 658 |
+
outputs=[editable_table, processed_video_output, elapsed_time_display]
|
| 659 |
)
|
| 660 |
|
| 661 |
# Connect submit button to save_feedback_db function
|