Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
·
05bf1ca
1
Parent(s):
108e387
修复GPT一次回复实在太长时导致的ERROR, fix #141
Browse files
utils.py
CHANGED
@@ -172,7 +172,7 @@ def stream_predict(openai_api_key, system_prompt, history, inputs, chatbot, prev
|
|
172 |
try:
|
173 |
partial_words = partial_words + chunk['choices'][0]["delta"]["content"]
|
174 |
except KeyError:
|
175 |
-
status_text = standard_error_msg + "API回复中找不到内容。很可能是Token
|
176 |
yield get_return_value()
|
177 |
break
|
178 |
if token_counter == 0:
|
|
|
172 |
try:
|
173 |
partial_words = partial_words + chunk['choices'][0]["delta"]["content"]
|
174 |
except KeyError:
|
175 |
+
status_text = standard_error_msg + "API回复中找不到内容。很可能是Token计数达到上限了。请重置对话。当前Token计数: " + str(sum(previous_token_count)+token_counter+user_token_count)
|
176 |
yield get_return_value()
|
177 |
break
|
178 |
if token_counter == 0:
|