Spaces:
Runtime error
Runtime error
prevent reloading same model, change event in gradio dropdown happens often?
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import whisper
|
|
3 |
from pytube import YouTube
|
4 |
|
5 |
loaded_model = whisper.load_model("base")
|
6 |
-
|
7 |
def inference(link):
|
8 |
yt = YouTube(link)
|
9 |
path = yt.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
|
@@ -12,6 +12,8 @@ def inference(link):
|
|
12 |
return results['text']
|
13 |
|
14 |
def change_model(size):
|
|
|
|
|
15 |
loaded_model = whisper.load_model(size)
|
16 |
|
17 |
title="Youtube Whisperer"
|
|
|
3 |
from pytube import YouTube
|
4 |
|
5 |
loaded_model = whisper.load_model("base")
|
6 |
+
current_size = 'base'
|
7 |
def inference(link):
|
8 |
yt = YouTube(link)
|
9 |
path = yt.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
|
|
|
12 |
return results['text']
|
13 |
|
14 |
def change_model(size):
|
15 |
+
if size == curren_size:
|
16 |
+
return
|
17 |
loaded_model = whisper.load_model(size)
|
18 |
|
19 |
title="Youtube Whisperer"
|