Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,10 +7,10 @@ loaded_model = whisper.load_model("medium")
|
|
7 |
current_size = 'medium'
|
8 |
def inference(link):
|
9 |
yt = YouTube(link)
|
|
|
|
|
|
|
10 |
#path = yt.streams.get_audio_only().download(mp3=True)
|
11 |
-
|
12 |
-
path = dowload_youtube_video(link)
|
13 |
-
|
14 |
options = whisper.DecodingOptions(language= 'Spanish', without_timestamps=True)
|
15 |
results = loaded_model.transcribe(path)
|
16 |
return results['text']
|
|
|
7 |
current_size = 'medium'
|
8 |
def inference(link):
|
9 |
yt = YouTube(link)
|
10 |
+
global audio_stream
|
11 |
+
audio_stream = yt.streams.filter(only_audio=True, file_extension='mp4').first()
|
12 |
+
path = audio_stream.download()
|
13 |
#path = yt.streams.get_audio_only().download(mp3=True)
|
|
|
|
|
|
|
14 |
options = whisper.DecodingOptions(language= 'Spanish', without_timestamps=True)
|
15 |
results = loaded_model.transcribe(path)
|
16 |
return results['text']
|