Spaces:
Runtime error
Runtime error
from translate import Translate # Import the Translate class | |
import gradio as gr | |
import os | |
from google.colab import files | |
def app(video_path, original_language, target_language): | |
translator = Translate(video_path, original_language, target_language) | |
video_file = translator.translate_video() | |
return video_file | |
# Gradio's built-in File component handles download functionality | |
interface_video_file = gr.Interface( | |
fn=app, | |
inputs=[ | |
gr.Video(label="Video Path"), | |
gr.Dropdown(["English", "German", "Italian", "Spanish"], label="Original Language"), | |
gr.Dropdown(["English", "German", "Italian", "Spanish"], label="Targeted Language"), | |
], | |
outputs=gr.Video(label="Translated Video") | |
) | |
interface_video_file.launch(debug=True) | |