Yusin commited on
Commit
3e5ca9e
1 Parent(s): 15eced2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -33,11 +33,14 @@ def chat_hf(audio, custom_token, language):
33
  gpt_response = "MISSING AUDIO: Record your voice by clicking the microphone button, do not forget to stop recording before sending your message ;)"
34
  else:
35
  #gpt_response = chatbot.ask(whisper_text, conversation_id=conversation_id, parent_id=None)
 
36
  if chat_id['conversation_id'] != None:
37
  data = {"content": whisper_text, "conversation_id": chat_id['conversation_id'], "parent_id": chat_id['parent_id']}
38
  else:
39
  data = {"content": whisper_text}
 
40
  response = requests.post('http://192.168.43.32:7788/api/ask', headers=headers, json=data)
 
41
  chat_id['parent_id'] = response.json()["response_id"]
42
  chat_id['conversation_id'] = response.json()["conversation_id"]
43
  gpt_response = response.json()["content"]
 
33
  gpt_response = "MISSING AUDIO: Record your voice by clicking the microphone button, do not forget to stop recording before sending your message ;)"
34
  else:
35
  #gpt_response = chatbot.ask(whisper_text, conversation_id=conversation_id, parent_id=None)
36
+ print(whisper_text)
37
  if chat_id['conversation_id'] != None:
38
  data = {"content": whisper_text, "conversation_id": chat_id['conversation_id'], "parent_id": chat_id['parent_id']}
39
  else:
40
  data = {"content": whisper_text}
41
+ print(data)
42
  response = requests.post('http://192.168.43.32:7788/api/ask', headers=headers, json=data)
43
+ print(response.text)
44
  chat_id['parent_id'] = response.json()["response_id"]
45
  chat_id['conversation_id'] = response.json()["conversation_id"]
46
  gpt_response = response.json()["content"]