Eriberto commited on
Commit
8764ad0
1 Parent(s): f87a54b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -240,12 +240,16 @@ def chat(input0, input1, chat_radio, chat_history):
240
  out_chat = []
241
  if chat_history != '':
242
  out_chat = json.loads(chat_history)
243
- logger.info(f"out_chat_: {len(out_chat)} / {chat_radio}")
244
- if chat_radio == "Talk to chatGPT":
245
- response = get_response_from_chatgpt(input0)
246
- out_chat.append((input0, response))
247
- chat_history = json.dumps(out_chat)
248
- return out_chat, input1, chat_history
 
 
 
 
249
 
250
 
251
  with gr.Blocks(title='Talk to chatGPT') as demo:
 
240
  out_chat = []
241
  if chat_history != '':
242
  out_chat = json.loads(chat_history)
243
+ #if chat_radio == "Talk to chatGPT":
244
+ response = get_response_from_chatgpt(input0)
245
+ out_chat.append((input0, response))
246
+ chat_history = json.dumps(out_chat)
247
+
248
+
249
+
250
+ logger.info(f"out_chat_input0 and input1 {input0} -- {input1}")
251
+ logger.info(f"chat history {chat_history}")
252
+ return out_chat, input1, chat_history
253
 
254
 
255
  with gr.Blocks(title='Talk to chatGPT') as demo: