Spaces:
Sleeping
Sleeping
frogcho123
commited on
Commit
·
3420bec
1
Parent(s):
89d0a94
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ import gradio as gr
|
|
3 |
import whisper
|
4 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
5 |
from gtts import gTTS
|
|
|
|
|
6 |
|
7 |
def translate_voice(file, target_lang):
|
8 |
try:
|
@@ -20,7 +22,7 @@ def translate_voice(file, target_lang):
|
|
20 |
|
21 |
# Proceed with your language detection and decoding
|
22 |
_, probs = model.detect_language(mel)
|
23 |
-
options = whisper.DecodingOptions(
|
24 |
result = whisper.decode(model, mel, options)
|
25 |
|
26 |
text = result.text
|
@@ -59,4 +61,3 @@ iface = gr.Interface(
|
|
59 |
]
|
60 |
)
|
61 |
iface.launch()
|
62 |
-
|
|
|
3 |
import whisper
|
4 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
5 |
from gtts import gTTS
|
6 |
+
import sentencepiece
|
7 |
+
|
8 |
|
9 |
def translate_voice(file, target_lang):
|
10 |
try:
|
|
|
22 |
|
23 |
# Proceed with your language detection and decoding
|
24 |
_, probs = model.detect_language(mel)
|
25 |
+
options = whisper.DecodingOptions()
|
26 |
result = whisper.decode(model, mel, options)
|
27 |
|
28 |
text = result.text
|
|
|
61 |
]
|
62 |
)
|
63 |
iface.launch()
|
|