Update app.py
Browse files
app.py
CHANGED
@@ -77,12 +77,12 @@ def return_prediction_whisper_mic(mic=None, device=device):
|
|
77 |
|
78 |
@spaces.GPU(duration=30)
|
79 |
def return_prediction_whisper_file(file=None, device=device):
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
|
87 |
recap_result = ""
|
88 |
prev_segment = ""
|
|
|
77 |
|
78 |
@spaces.GPU(duration=30)
|
79 |
def return_prediction_whisper_file(file=None, device=device):
|
80 |
+
if file is not None:
|
81 |
+
waveform, sr = librosa.load(file, sr=16000)
|
82 |
+
waveform = waveform[:3600*sr]
|
83 |
+
whisper_result = whisper_classifier.classify_file_whisper_mkd_streaming(waveform, device)
|
84 |
+
else:
|
85 |
+
yield "You must provide a mic recording"
|
86 |
|
87 |
recap_result = ""
|
88 |
prev_segment = ""
|