hunyuan-t commited on
Commit
da413e9
·
verified ·
1 Parent(s): ef094af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -45,10 +45,13 @@ def respond(
45
  )
46
  response = ""
47
 
48
- for event in completion:
49
- if event.choices[0].delta.reasoning_content:
 
 
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)