EmadSalem commited on
Commit
6dcb5e7
·
1 Parent(s): bb0c7c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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
- return whisper_text, gpt_response, fp.name
 
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):