Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
•
9cfd027
1
Parent(s):
ab74909
改进代码质量
Browse files
utils.py
CHANGED
@@ -178,7 +178,6 @@ def stream_predict(openai_api_key, system_prompt, history, inputs, chatbot, all_
|
|
178 |
finish_reason = chunk['choices'][0]['finish_reason']
|
179 |
status_text = construct_token_message(sum(all_token_counts), stream=True)
|
180 |
if finish_reason == "stop":
|
181 |
-
print("生成完毕")
|
182 |
yield get_return_value()
|
183 |
break
|
184 |
try:
|
@@ -216,7 +215,6 @@ def predict_all(openai_api_key, system_prompt, history, inputs, chatbot, all_tok
|
|
216 |
total_token_count = response["usage"]["total_tokens"]
|
217 |
all_token_counts[-1] = total_token_count - sum(all_token_counts)
|
218 |
status_text = construct_token_message(total_token_count)
|
219 |
-
print("生成一次性回答完毕")
|
220 |
return chatbot, history, status_text, all_token_counts
|
221 |
|
222 |
|
|
|
178 |
finish_reason = chunk['choices'][0]['finish_reason']
|
179 |
status_text = construct_token_message(sum(all_token_counts), stream=True)
|
180 |
if finish_reason == "stop":
|
|
|
181 |
yield get_return_value()
|
182 |
break
|
183 |
try:
|
|
|
215 |
total_token_count = response["usage"]["total_tokens"]
|
216 |
all_token_counts[-1] = total_token_count - sum(all_token_counts)
|
217 |
status_text = construct_token_message(total_token_count)
|
|
|
218 |
return chatbot, history, status_text, all_token_counts
|
219 |
|
220 |
|