Spaces:
Build error
Build error
aa
Browse files
app.py
CHANGED
@@ -17,6 +17,7 @@ headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
|
17 |
|
18 |
# Text-to-Speech
|
19 |
LANGUAGES = list(CoquiTTS.langs.keys())
|
|
|
20 |
coquiTTS = CoquiTTS()
|
21 |
|
22 |
|
@@ -42,8 +43,8 @@ def whisper_stt(audio):
|
|
42 |
|
43 |
# Processing input Audio
|
44 |
def fun_engine(audio) :
|
45 |
-
|
46 |
-
text1 = model.transcribe(audio)["text"]
|
47 |
text2 = lang_model_response(text1)
|
48 |
speech = tts(text, 'en')
|
49 |
return text1, text2, speech
|
@@ -82,11 +83,9 @@ def tts(text, language):
|
|
82 |
coquiTTS.get_tts(text, fp, speaker = {"language" : language})
|
83 |
return fp.name
|
84 |
|
85 |
-
#inputs = [gr.Textbox(label="Input", value=CoquiTTS.langs["en"]["sentence"], max_lines=3),
|
86 |
-
# gr.Radio(label="Language", choices=LANGUAGES, value="en")]
|
87 |
-
#outputs = gr.Audio(label="Output")
|
88 |
|
89 |
-
|
|
|
90 |
|
91 |
demo.launch()
|
92 |
gr.Interface(
|
|
|
17 |
|
18 |
# Text-to-Speech
|
19 |
LANGUAGES = list(CoquiTTS.langs.keys())
|
20 |
+
print(f"Languages for Coqui are: {LANGUAGES}")
|
21 |
coquiTTS = CoquiTTS()
|
22 |
|
23 |
|
|
|
43 |
|
44 |
# Processing input Audio
|
45 |
def fun_engine(audio) :
|
46 |
+
text1 = whisper_stt(audio)
|
47 |
+
#text1 = model.transcribe(audio)["text"]
|
48 |
text2 = lang_model_response(text1)
|
49 |
speech = tts(text, 'en')
|
50 |
return text1, text2, speech
|
|
|
83 |
coquiTTS.get_tts(text, fp, speaker = {"language" : language})
|
84 |
return fp.name
|
85 |
|
|
|
|
|
|
|
86 |
|
87 |
+
|
88 |
+
#demo = gr.Interface(fn=tts, inputs=inputs, outputs=outputs)
|
89 |
|
90 |
demo.launch()
|
91 |
gr.Interface(
|