yangtb24 commited on
Commit
812f8ea
·
verified ·
1 Parent(s): 3821439

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -501,24 +501,24 @@ def handsome_chat_completions():
501
  if delta.get("reasoning_content") is not None:
502
  if first_reasoning_chunk:
503
  openai_chunk["choices"][0]["delta"]["content"] = "<think>\n"
504
- openai_chunk["choices"][0]["delta"]["reasoning_content"] = "null"
505
  yield f"data: {json.dumps(openai_chunk)}\n\n"
506
  first_reasoning_chunk = False
507
 
508
  openai_chunk["choices"][0]["delta"]["content"] = delta["reasoning_content"]
509
- openai_chunk["choices"][0]["delta"]["reasoning_content"] = "null"
510
  yield f"data: {json.dumps(openai_chunk)}\n\n"
511
  reasoning_content_accumulated += delta["reasoning_content"]
512
 
513
  if delta.get("content") is not None:
514
  if not first_reasoning_chunk:
515
  openai_chunk["choices"][0]["delta"]["content"] = "\n</think>\n"
516
- openai_chunk["choices"][0]["delta"]["reasoning_content"] = "null"
517
  yield f"data: {json.dumps(openai_chunk)}\n\n"
518
  first_reasoning_chunk = True
519
 
520
  openai_chunk["choices"][0]["delta"]["content"] = delta["content"]
521
- openai_chunk["choices"][0]["delta"]["reasoning_content"] = "null"
522
  yield f"data: {json.dumps(openai_chunk)}\n\n"
523
  content_accumulated += delta["content"]
524
 
 
501
  if delta.get("reasoning_content") is not None:
502
  if first_reasoning_chunk:
503
  openai_chunk["choices"][0]["delta"]["content"] = "<think>\n"
504
+ openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
505
  yield f"data: {json.dumps(openai_chunk)}\n\n"
506
  first_reasoning_chunk = False
507
 
508
  openai_chunk["choices"][0]["delta"]["content"] = delta["reasoning_content"]
509
+ openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
510
  yield f"data: {json.dumps(openai_chunk)}\n\n"
511
  reasoning_content_accumulated += delta["reasoning_content"]
512
 
513
  if delta.get("content") is not None:
514
  if not first_reasoning_chunk:
515
  openai_chunk["choices"][0]["delta"]["content"] = "\n</think>\n"
516
+ openai_chunk["choices"][0]["delta"]["reasoning_content"] = null
517
  yield f"data: {json.dumps(openai_chunk)}\n\n"
518
  first_reasoning_chunk = True
519
 
520
  openai_chunk["choices"][0]["delta"]["content"] = delta["content"]
521
+ openai_chunk["choices"][0]["delta"]["reasoning_content"] = None
522
  yield f"data: {json.dumps(openai_chunk)}\n\n"
523
  content_accumulated += delta["content"]
524