hunyuan-t commited on
Commit
d14052c
Β·
verified Β·
1 Parent(s): 5ecc655

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -50,15 +50,16 @@ def respond(
50
 
51
  for event in completion:
52
  if hasattr(event.choices[0].delta, 'reasoning_content'):
53
- if is_reasoning_start:
54
  response += '> **开始思考**\n\n'
55
  is_reasoning_start = False
56
- token = event.choices[0].delta.reasoning_content
57
- else:
58
- if is_reasoning_end:
59
  response += '> **η»“ζŸζ€θ€ƒ**\n\n'
60
  is_reasoning_end = False
61
- token = event.choices[0].delta.content
 
62
  yield response
63
  except Exception as e:
64
  raise gr.Error(f"ε‘η”Ÿι”™θ――: {str(e)}")
 
50
 
51
  for event in completion:
52
  if hasattr(event.choices[0].delta, 'reasoning_content'):
53
+ ifis_reasoning_start:
54
  response += '> **开始思考**\n\n'
55
  is_reasoning_start = False
56
+ token = event.choices[0].delta.reasoning_content# Wrap reasoning_content in a span with a lighter color
57
+ response += f'<span style="color: #999999;">{token}</span>'
58
+ else:if is_reasoning_end:
59
  response += '> **η»“ζŸζ€θ€ƒ**\n\n'
60
  is_reasoning_end = False
61
+ token = event.choices[0].delta.content# Wrap content in a span with a normal color
62
+ response += f'<span style="color: #000000;">{token}</span>'
63
  yield response
64
  except Exception as e:
65
  raise gr.Error(f"ε‘η”Ÿι”™θ――: {str(e)}")