Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -128,11 +128,13 @@ with gr.Blocks() as demo:
|
|
128 |
"frequency_penalty": FREQUENCY_PENALTY,
|
129 |
}
|
130 |
|
131 |
-
outputs = requests.post(API_URL, headers=HEADERS, data=json.dumps(data)).json()
|
|
|
|
|
132 |
if history[-1][1] is None:
|
133 |
-
history[-1][1] =
|
134 |
else:
|
135 |
-
history[-1][1] +=
|
136 |
return history
|
137 |
|
138 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
|
|
128 |
"frequency_penalty": FREQUENCY_PENALTY,
|
129 |
}
|
130 |
|
131 |
+
outputs = requests.post(API_URL, headers=HEADERS, data=json.dumps(data)).json()
|
132 |
+
print(outputs)
|
133 |
+
response = outputs['choices'][0]['text']
|
134 |
if history[-1][1] is None:
|
135 |
+
history[-1][1] = response
|
136 |
else:
|
137 |
+
history[-1][1] += response
|
138 |
return history
|
139 |
|
140 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|