Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -235,17 +235,15 @@ def bot(history, job, resume, job_params):
|
|
235 |
engine="gpt-4-1106",
|
236 |
messages=messages,
|
237 |
temperature=0.0,
|
238 |
-
stream=True,
|
239 |
)
|
240 |
-
|
241 |
-
print(response)
|
242 |
|
243 |
-
history[-1][1] = ""
|
244 |
-
for chunk in response:
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
if history[-1][1] == "Thank you for conducting the evaluation! We will get back to you shortly.":
|
250 |
print("finished")
|
251 |
send_evaluation(history, job, resume, job_params)
|
|
|
235 |
engine="gpt-4-1106",
|
236 |
messages=messages,
|
237 |
temperature=0.0,
|
238 |
+
#stream=True,
|
239 |
)
|
|
|
|
|
240 |
|
241 |
+
history[-1][1] = response["choices"][0]["message"]["content"]
|
242 |
+
#for chunk in response:
|
243 |
+
# print(chunk)
|
244 |
+
# if len(chunk["choices"][0]["delta"]) != 0 and hasattr(chunk["choices"][0]["delta"], "content"):
|
245 |
+
# history[-1][1] = history[-1][1] + chunk["choices"][0]["delta"]["content"]
|
246 |
+
# yield history
|
247 |
if history[-1][1] == "Thank you for conducting the evaluation! We will get back to you shortly.":
|
248 |
print("finished")
|
249 |
send_evaluation(history, job, resume, job_params)
|