RobCaamano's picture
Update app.py
e0c6e50
raw
history blame
1.07 kB
import gradio as gr
from main import main as process_video
def run_pipeline(youtube_url):
# Run the main processing function from your script
# This function should save the final video in the '/translated/' directory
final_video_path = process_video(youtube_url)
# Return the path for Gradio to display
return final_video_path
with gr.Blocks() as demo:
gr.Markdown(
"""
Enter a YouTube URL to process the video through transcription, translation, and more.
""",
elem_id="header",
)
with gr.Column():
user_prompt = gr.Textbox(
placeholder="Enter YouTube Video URL here...",
label="Input",
)
btn = gr.Button("Convert", label="Convert")
with gr.Column():
generated_video = gr.Video(
interactive=False, label="Generated Video", include_audio=True
)
btn.click(
fn=run_pipeline,
inputs=user_prompt,
outputs=generated_video
)
if __name__ == "__main__":
demo.launch(show_error=True)