Yusin commited on
Commit
72d7b91
1 Parent(s): ba11b0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -26,12 +26,14 @@ def chat_hf(audio, custom_token, language):
26
  if whisper_text == "ERROR: You have to either use the microphone or upload an audio file":
27
  gpt_response = "MISSING AUDIO: Record your voice by clicking the microphone button, do not forget to stop recording before sending your message ;)"
28
  else:
29
- gpt_response = chatgpt(whisper_text)
 
30
 
31
  except:
32
  whisper_text = translate(audio)
33
  gpt_response = """Sorry, I'm quite busy right now, but please try again later :)"""
34
-
 
35
  # to voice
36
  with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
37
  coquiTTS.get_tts(gpt_response, fp, speaker = {"language" : language})
 
26
  if whisper_text == "ERROR: You have to either use the microphone or upload an audio file":
27
  gpt_response = "MISSING AUDIO: Record your voice by clicking the microphone button, do not forget to stop recording before sending your message ;)"
28
  else:
29
+ gpt_response, _ = chatgpt(whisper_text, [])
30
+ gpt_response = gpt_response[0]
31
 
32
  except:
33
  whisper_text = translate(audio)
34
  gpt_response = """Sorry, I'm quite busy right now, but please try again later :)"""
35
+
36
+ print(gpt_response)
37
  # to voice
38
  with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
39
  coquiTTS.get_tts(gpt_response, fp, speaker = {"language" : language})