Spaces:
Runtime error
Runtime error
Commit
·
cd6653c
1
Parent(s):
33e874a
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ def translate_voice(file, target_lang):
|
|
9 |
model = whisper.load_model("base")
|
10 |
audio = whisper.load_audio(file.name)
|
11 |
audio = whisper.pad_or_trim(audio)
|
12 |
-
mel = whisper.log_mel_spectrogram(audio).to(model.device)
|
13 |
_, probs = model.detect_language(mel)
|
14 |
|
15 |
options = whisper.DecodingOptions()
|
|
|
9 |
model = whisper.load_model("base")
|
10 |
audio = whisper.load_audio(file.name)
|
11 |
audio = whisper.pad_or_trim(audio)
|
12 |
+
mel = whisper.log_mel_spectrogram(audio).to(model.device).float()
|
13 |
_, probs = model.detect_language(mel)
|
14 |
|
15 |
options = whisper.DecodingOptions()
|