mobinln commited on
Commit
059b292
·
verified ·
1 Parent(s): ba9a48d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -46,8 +46,7 @@ def respond(
46
  delta = message['choices'][0]['delta']
47
  if 'content' in delta:
48
  response += delta['content']
49
- formatted_response = re.sub(r'<think>(.*?)</think>', r'*\1*', response)
50
- print(f"*- {response}")
51
  yield formatted_response
52
 
53
 
 
46
  delta = message['choices'][0]['delta']
47
  if 'content' in delta:
48
  response += delta['content']
49
+ formatted_response = re.sub(r"<think>\s*(.*?)\s*</think>", r"*\1*", response, flags=re.DOTALL)
 
50
  yield formatted_response
51
 
52