Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -45,10 +45,13 @@ def respond(
|
|
45 |
)
|
46 |
response = ""
|
47 |
|
48 |
-
for event in completion:
|
49 |
-
if event.choices[0].delta
|
|
|
|
|
50 |
token = event.choices[0].delta.reasoning_content
|
51 |
else:
|
|
|
52 |
token = event.choices[0].delta.content
|
53 |
# if message.find('写一篇关于青春的五言绝句') != -1:
|
54 |
# print(11111111111)
|
|
|
45 |
)
|
46 |
response = ""
|
47 |
|
48 |
+
for index, event in enumerate(completion):
|
49 |
+
if hasattr(event.choices[0].delta, 'reasoning_content'):
|
50 |
+
if index == 0:
|
51 |
+
response += '=================开始思考================='
|
52 |
token = event.choices[0].delta.reasoning_content
|
53 |
else:
|
54 |
+
response += '=================结束思考================='
|
55 |
token = event.choices[0].delta.content
|
56 |
# if message.find('写一篇关于青春的五言绝句') != -1:
|
57 |
# print(11111111111)
|