Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -135,24 +135,20 @@ class Gradio_Events:
|
|
135 |
stream=True)
|
136 |
thought_done = False
|
137 |
for chunk in response:
|
138 |
-
reasoning_content = chunk.choices[0].delta.reasoning_content
|
139 |
content = chunk.choices[0].delta.content
|
140 |
history[-1]["loading"] = False
|
141 |
|
142 |
if content and not thought_done:
|
143 |
thought_done = True
|
144 |
-
history[-1]["meta"]["reason_content"] = history[-1][
|
145 |
-
"content"]
|
146 |
|
147 |
-
print("Reason: ",history[-1]["meta"]["reason_content"])
|
148 |
|
149 |
history[-1]["content"] = ""
|
150 |
-
history[-1]["meta"]["thought_end_message"] = get_text(
|
151 |
-
|
152 |
-
|
153 |
-
history[-1]["content"] += reasoning_content or ""
|
154 |
-
else:
|
155 |
-
history[-1]["content"] += content or ""
|
156 |
|
157 |
yield {
|
158 |
chatbot: gr.update(items=history),
|
|
|
135 |
stream=True)
|
136 |
thought_done = False
|
137 |
for chunk in response:
|
138 |
+
# reasoning_content = chunk.choices[0].delta.reasoning_content
|
139 |
content = chunk.choices[0].delta.content
|
140 |
history[-1]["loading"] = False
|
141 |
|
142 |
if content and not thought_done:
|
143 |
thought_done = True
|
144 |
+
#history[-1]["meta"]["reason_content"] = history[-1]["content"]
|
|
|
145 |
|
146 |
+
# print("Reason: ",history[-1]["meta"]["reason_content"])
|
147 |
|
148 |
history[-1]["content"] = ""
|
149 |
+
# history[-1]["meta"]["thought_end_message"] = get_text("End of Thought", "已深度思考")
|
150 |
+
|
151 |
+
history[-1]["content"] += content or ""
|
|
|
|
|
|
|
152 |
|
153 |
yield {
|
154 |
chatbot: gr.update(items=history),
|