Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import whisper
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
model = whisper.load_model("
|
| 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 |
-
|
| 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")
|