yangtb24 commited on
Commit
61be6cd
·
verified ·
1 Parent(s): d76bc2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -447,7 +447,7 @@ def handsome_chat_completions():
447
 
448
  if delta.get("reasoning_content") is not None:
449
  reasoning_content_accumulated += delta.get("reasoning_content", "")
450
- formatted_reasoning = f"```Thinking\n{reasoning_content_accumulated}\n"
451
  yield f"data: {json.dumps({'choices': [{'delta': {'content': formatted_reasoning}, 'index': 0, 'finish_reason': None}]})}\n\n"
452
  reasoning_content_accumulated = ""
453
 
@@ -567,7 +567,7 @@ def handsome_chat_completions():
567
  choice = response_json["choices"][0]
568
  if "message" in choice:
569
  if "reasoning_content" in choice["message"]:
570
- formatted_reasoning = f"debug-start\n{choice['message']['reasoning_content']}debug-end"
571
  response_content += formatted_reasoning + "\n"
572
  if "content" in choice["message"]:
573
  response_content += choice["message"]["content"]
@@ -673,4 +673,4 @@ if __name__ == '__main__':
673
  debug=False,
674
  host='0.0.0.0',
675
  port=int(os.environ.get('PORT', 7860))
676
- )
 
447
 
448
  if delta.get("reasoning_content") is not None:
449
  reasoning_content_accumulated += delta.get("reasoning_content", "")
450
+ formatted_reasoning = f"debug-start{reasoning_content_accumulated}debug-end"
451
  yield f"data: {json.dumps({'choices': [{'delta': {'content': formatted_reasoning}, 'index': 0, 'finish_reason': None}]})}\n\n"
452
  reasoning_content_accumulated = ""
453
 
 
567
  choice = response_json["choices"][0]
568
  if "message" in choice:
569
  if "reasoning_content" in choice["message"]:
570
+ formatted_reasoning = f"```Thinking\n{choice['message']['reasoning_content']}\n```"
571
  response_content += formatted_reasoning + "\n"
572
  if "content" in choice["message"]:
573
  response_content += choice["message"]["content"]
 
673
  debug=False,
674
  host='0.0.0.0',
675
  port=int(os.environ.get('PORT', 7860))
676
+ )