Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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:
|