Enable Whisper
Browse files
app.py
CHANGED
|
@@ -69,8 +69,8 @@ def transcribe(aud_inp):
|
|
| 69 |
aud = whisper.load_audio(aud_inp)
|
| 70 |
aud = whisper.pad_or_trim(aud)
|
| 71 |
mel = whisper.log_mel_spectrogram(aud).to(WHISPER_MODEL.device)
|
| 72 |
-
_, probs = WHISPER_MODEL.detect_language(mel)
|
| 73 |
-
options = whisper.DecodingOptions()
|
| 74 |
result = whisper.decode(WHISPER_MODEL, mel, options)
|
| 75 |
print("result.text", result.text)
|
| 76 |
result_text = ""
|
|
|
|
| 69 |
aud = whisper.load_audio(aud_inp)
|
| 70 |
aud = whisper.pad_or_trim(aud)
|
| 71 |
mel = whisper.log_mel_spectrogram(aud).to(WHISPER_MODEL.device)
|
| 72 |
+
# _, probs = WHISPER_MODEL.detect_language(mel)
|
| 73 |
+
options = whisper.DecodingOptions(language="ja")
|
| 74 |
result = whisper.decode(WHISPER_MODEL, mel, options)
|
| 75 |
print("result.text", result.text)
|
| 76 |
result_text = ""
|