Update app.py
Browse files
app.py
CHANGED
@@ -281,22 +281,22 @@ def build_interface():
|
|
281 |
/* Set column widths */
|
282 |
[data-testid="block-container"] .scrolling-dataframe th:nth-child(1),
|
283 |
[data-testid="block-container"] .scrolling-dataframe td:nth-child(1) {
|
284 |
-
width:
|
285 |
}
|
286 |
|
287 |
[data-testid="block-container"] .scrolling-dataframe th:nth-child(2),
|
288 |
[data-testid="block-container"] .scrolling-dataframe td:nth-child(2) {
|
289 |
-
width:
|
290 |
}
|
291 |
|
292 |
[data-testid="block-container"] .scrolling-dataframe th:nth-child(3),
|
293 |
[data-testid="block-container"] .scrolling-dataframe td:nth-child(3) {
|
294 |
-
width:
|
295 |
}
|
296 |
|
297 |
[data-testid="block-container"] .scrolling-dataframe th:nth-child(4),
|
298 |
[data-testid="block-container"] .scrolling-dataframe td:nth-child(4) {
|
299 |
-
width:
|
300 |
}
|
301 |
"""
|
302 |
with gr.Blocks(css=css) as demo:
|
@@ -305,6 +305,9 @@ def build_interface():
|
|
305 |
with gr.Column(scale=4):
|
306 |
file_input = gr.File(label="Upload Video/Audio File")
|
307 |
language_input = gr.Dropdown(["en", "es", "fr", "zh"], label="Select Language") # Language codes
|
|
|
|
|
|
|
308 |
submit_button = gr.Button("Post and Process")
|
309 |
editable_translations = gr.State(value=[])
|
310 |
|
@@ -352,10 +355,10 @@ def build_interface():
|
|
352 |
|
353 |
submit_button.click(
|
354 |
upload_and_manage,
|
355 |
-
inputs=[file_input, language_input],
|
356 |
outputs=[editable_translations, editable_table, processed_video_output, elapsed_time_display]
|
357 |
)
|
358 |
-
|
359 |
# Connect submit button to save_feedback_db function
|
360 |
feedback_btn.click(
|
361 |
feedback_submission,
|
|
|
281 |
/* Set column widths */
|
282 |
[data-testid="block-container"] .scrolling-dataframe th:nth-child(1),
|
283 |
[data-testid="block-container"] .scrolling-dataframe td:nth-child(1) {
|
284 |
+
width: 5%; /* Start column */
|
285 |
}
|
286 |
|
287 |
[data-testid="block-container"] .scrolling-dataframe th:nth-child(2),
|
288 |
[data-testid="block-container"] .scrolling-dataframe td:nth-child(2) {
|
289 |
+
width: 45%; /* Original text */
|
290 |
}
|
291 |
|
292 |
[data-testid="block-container"] .scrolling-dataframe th:nth-child(3),
|
293 |
[data-testid="block-container"] .scrolling-dataframe td:nth-child(3) {
|
294 |
+
width: 45%; /* Translated text */
|
295 |
}
|
296 |
|
297 |
[data-testid="block-container"] .scrolling-dataframe th:nth-child(4),
|
298 |
[data-testid="block-container"] .scrolling-dataframe td:nth-child(4) {
|
299 |
+
width: 5%; /* End column */
|
300 |
}
|
301 |
"""
|
302 |
with gr.Blocks(css=css) as demo:
|
|
|
305 |
with gr.Column(scale=4):
|
306 |
file_input = gr.File(label="Upload Video/Audio File")
|
307 |
language_input = gr.Dropdown(["en", "es", "fr", "zh"], label="Select Language") # Language codes
|
308 |
+
process_mode = gr.Radio(choices=["Transcription", "Transcription with Voiceover"],
|
309 |
+
label="Choose Processing Type",
|
310 |
+
value="Transcription" # Default to "Transcription")
|
311 |
submit_button = gr.Button("Post and Process")
|
312 |
editable_translations = gr.State(value=[])
|
313 |
|
|
|
355 |
|
356 |
submit_button.click(
|
357 |
upload_and_manage,
|
358 |
+
inputs=[file_input, language_input, process_mode],
|
359 |
outputs=[editable_translations, editable_table, processed_video_output, elapsed_time_display]
|
360 |
)
|
361 |
+
|
362 |
# Connect submit button to save_feedback_db function
|
363 |
feedback_btn.click(
|
364 |
feedback_submission,
|