RobCaamano's picture
Update app.py
8ea135a
raw
history blame
1.03 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...",
)
btn = gr.Button("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)