Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
·
2242318
1
Parent(s):
f60fb0f
修复变量名
Browse files- ChuanhuChatbot.py +1 -1
ChuanhuChatbot.py
CHANGED
|
@@ -152,7 +152,7 @@ def predict(inputs, top_p, temperature, openai_api_key, chatbot=[], history=[],
|
|
| 152 |
try:
|
| 153 |
if len(json.loads(chunk.decode()[6:])['choices'][0]["delta"]) == 0:
|
| 154 |
chunkjson = json.loads(chunk.decode()[6:])
|
| 155 |
-
status_text = f"id: {
|
| 156 |
yield chatbot, history, status_text
|
| 157 |
break
|
| 158 |
except Exception as e:
|
|
|
|
| 152 |
try:
|
| 153 |
if len(json.loads(chunk.decode()[6:])['choices'][0]["delta"]) == 0:
|
| 154 |
chunkjson = json.loads(chunk.decode()[6:])
|
| 155 |
+
status_text = f"id: {chunkjson['id']}, finish_reason: {chunkjson['choices'][0]['finish_reason']}"
|
| 156 |
yield chatbot, history, status_text
|
| 157 |
break
|
| 158 |
except Exception as e:
|