Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ def transcribe(audio):
|
|
| 22 |
|
| 23 |
#time.sleep(3)
|
| 24 |
# load audio and pad/trim it to fit 30 seconds
|
| 25 |
-
audio = whisper.load_audio(
|
| 26 |
audio = whisper.pad_or_trim(audio)
|
| 27 |
|
| 28 |
# make log-Mel spectrogram and move to the same device as the model
|
|
@@ -33,7 +33,7 @@ def transcribe(audio):
|
|
| 33 |
print(f"Detected language: {max(probs, key=probs.get)}")
|
| 34 |
|
| 35 |
# decode the audio
|
| 36 |
-
options = whisper.DecodingOptions(fp16 =
|
| 37 |
result = whisper.decode(model, mel, options)
|
| 38 |
return result.text
|
| 39 |
|
|
|
|
| 22 |
|
| 23 |
#time.sleep(3)
|
| 24 |
# load audio and pad/trim it to fit 30 seconds
|
| 25 |
+
audio = whisper.load_audio(audio_file)
|
| 26 |
audio = whisper.pad_or_trim(audio)
|
| 27 |
|
| 28 |
# make log-Mel spectrogram and move to the same device as the model
|
|
|
|
| 33 |
print(f"Detected language: {max(probs, key=probs.get)}")
|
| 34 |
|
| 35 |
# decode the audio
|
| 36 |
+
options = whisper.DecodingOptions(fp16 = False)
|
| 37 |
result = whisper.decode(model, mel, options)
|
| 38 |
return result.text
|
| 39 |
|