Spaces:
Sleeping
Sleeping
fix: translation err's
Browse files
app.py
CHANGED
@@ -18,16 +18,14 @@ def transcribe(audio):
|
|
18 |
print(f"Detected language: {max(probs, key=probs.get)}")
|
19 |
|
20 |
# decode the audio
|
21 |
-
options = whisper.DecodingOptions(fp16 = False)
|
22 |
result = whisper.decode(model, mel, options)
|
23 |
-
|
24 |
-
newresult = whisper.translate(result, "en")
|
25 |
-
return newresult.text
|
26 |
|
27 |
|
28 |
|
29 |
gr.Interface(
|
30 |
-
title = 'OpenAI Whisper ASR
|
31 |
fn=transcribe,
|
32 |
inputs=[
|
33 |
gr.inputs.Audio(source="microphone", type="filepath")
|
|
|
18 |
print(f"Detected language: {max(probs, key=probs.get)}")
|
19 |
|
20 |
# decode the audio
|
21 |
+
options = whisper.DecodingOptions(fp16 = False, task = "translate")
|
22 |
result = whisper.decode(model, mel, options)
|
23 |
+
return result.text
|
|
|
|
|
24 |
|
25 |
|
26 |
|
27 |
gr.Interface(
|
28 |
+
title = 'WhisperAnything — OpenAI Whisper ASR to EN',
|
29 |
fn=transcribe,
|
30 |
inputs=[
|
31 |
gr.inputs.Audio(source="microphone", type="filepath")
|