yangtb24 commited on
Commit
be79f4f
·
verified ·
1 Parent(s): 95bf044

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -512,16 +512,16 @@ def handsome_chat_completions():
512
  openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
513
  yield f"data: {json.dumps(openai_chunk)}\n\n"
514
  first_reasoning_chunk = False
515
-
516
- openai_chunk["choices"][0]["delta"]["content"] = delta["reasoning_content"]
517
- openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
518
- yield f"data: {json.dumps(openai_chunk)}\n\n"
519
- reasoning_content_accumulated += delta["reasoning_content"]
520
 
521
  if delta.get("content") is not None:
522
  if not first_reasoning_chunk:
523
  openai_chunk["choices"][0]["delta"]["content"] = "\n</think>\n"
524
- openai_chunk["choices"][0]["delta"]["reasoning_content"] = null
525
  yield f"data: {json.dumps(openai_chunk)}\n\n"
526
  first_reasoning_chunk = True
527
 
 
512
  openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
513
  yield f"data: {json.dumps(openai_chunk)}\n\n"
514
  first_reasoning_chunk = False
515
+ else:
516
+ openai_chunk["choices"][0]["delta"]["content"] = delta["reasoning_content"]
517
+ openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
518
+ yield f"data: {json.dumps(openai_chunk)}\n\n"
519
+ reasoning_content_accumulated += delta["reasoning_content"]
520
 
521
  if delta.get("content") is not None:
522
  if not first_reasoning_chunk:
523
  openai_chunk["choices"][0]["delta"]["content"] = "\n</think>\n"
524
+ openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
525
  yield f"data: {json.dumps(openai_chunk)}\n\n"
526
  first_reasoning_chunk = True
527