Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ title = "Speech to ChatGPT to Speech"
|
|
19 |
|
20 |
|
21 |
# ChatGPT
|
22 |
-
def chat_hf(audio, custom_token):
|
23 |
try:
|
24 |
whisper_text = translate(audio)
|
25 |
api = ChatGPT(session_token)
|
@@ -39,10 +39,9 @@ def chat_hf(audio, custom_token):
|
|
39 |
gpt_response = resp['message']
|
40 |
|
41 |
# to voice
|
42 |
-
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
43 |
-
coquiTTS.get_tts(gpt_response, fp, speaker = {"language" : language})
|
44 |
|
45 |
-
|
|
|
46 |
|
47 |
# whisper
|
48 |
def translate(audio):
|
|
|
19 |
|
20 |
|
21 |
# ChatGPT
|
22 |
+
def chat_hf(audio, custom_token, language):
|
23 |
try:
|
24 |
whisper_text = translate(audio)
|
25 |
api = ChatGPT(session_token)
|
|
|
39 |
gpt_response = resp['message']
|
40 |
|
41 |
# to voice
|
|
|
|
|
42 |
|
43 |
+
|
44 |
+
return whisper_text, gpt_response
|
45 |
|
46 |
# whisper
|
47 |
def translate(audio):
|