dodoya1 commited on
Commit
d7ece34
1 Parent(s): b39e4f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  import whisper
3
  import os
4
 
5
- model = whisper.load_model("medium")
6
 
7
  # main processing
8
  def main(URL):
@@ -21,11 +21,7 @@ def youtube_dl(URL):
21
  os.system(f"yt-dlp -f best -v {URL} -o target.mp4")
22
  # Path of downloaded video
23
  video_path = os.path.join(os.path.dirname(__file__), "target.mp4")
24
- # Check if the video is downloaded successfully
25
- if os.path.exists(video_path):
26
- return video_path
27
- else:
28
- raise ValueError("Video download failed")
29
 
30
  demo = gr.Interface(fn = main,
31
  inputs = "text", outputs = "text")
 
2
  import whisper
3
  import os
4
 
5
+ model = whisper.load_model("tiny")
6
 
7
  # main processing
8
  def main(URL):
 
21
  os.system(f"yt-dlp -f best -v {URL} -o target.mp4")
22
  # Path of downloaded video
23
  video_path = os.path.join(os.path.dirname(__file__), "target.mp4")
24
+ return video_path
 
 
 
 
25
 
26
  demo = gr.Interface(fn = main,
27
  inputs = "text", outputs = "text")