RobCaamano commited on
Commit
e0c6e50
1 Parent(s): 956eabf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -12
app.py CHANGED
@@ -5,21 +5,34 @@ def run_pipeline(youtube_url):
5
  # Run the main processing function from your script
6
  # This function should save the final video in the '/translated/' directory
7
  final_video_path = process_video(youtube_url)
8
-
9
- # Construct the path to the final video
10
- # Assuming the video is named 'final_video.mp4' and stored in '/translated/'
11
- video = gr.Video()
12
 
13
  # Return the path for Gradio to display
14
  return final_video_path
15
 
16
- iface = gr.Interface(
17
- fn=run_pipeline,
18
- inputs=gr.Textbox(lines=2, placeholder="Enter YouTube Video URL here..."),
19
- outputs=video,
20
- title="YouTube Video Processing",
21
- description="Enter a YouTube URL to process the video through transcription, translation, and more."
22
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  if __name__ == "__main__":
25
- iface.launch()
 
5
  # Run the main processing function from your script
6
  # This function should save the final video in the '/translated/' directory
7
  final_video_path = process_video(youtube_url)
 
 
 
 
8
 
9
  # Return the path for Gradio to display
10
  return final_video_path
11
 
12
+ with gr.Blocks() as demo:
13
+ gr.Markdown(
14
+ """
15
+ Enter a YouTube URL to process the video through transcription, translation, and more.
16
+ """,
17
+ elem_id="header",
18
+ )
19
+ with gr.Column():
20
+ user_prompt = gr.Textbox(
21
+ placeholder="Enter YouTube Video URL here...",
22
+ label="Input",
23
+ )
24
+ btn = gr.Button("Convert", label="Convert")
25
+
26
+ with gr.Column():
27
+ generated_video = gr.Video(
28
+ interactive=False, label="Generated Video", include_audio=True
29
+ )
30
+
31
+ btn.click(
32
+ fn=run_pipeline,
33
+ inputs=user_prompt,
34
+ outputs=generated_video
35
+ )
36
 
37
  if __name__ == "__main__":
38
+ demo.launch(show_error=True)