Update app.py
Browse files
app.py
CHANGED
@@ -490,14 +490,14 @@ def handsome_chat_completions():
|
|
490 |
if first_reasoning_chunk:
|
491 |
reasoning_chunk = f"<think>\n{reasoning_chunk}"
|
492 |
first_reasoning_chunk = False
|
493 |
-
yield f"data: {json.dumps({'choices': [{'delta': {'content': reasoning_chunk, 'reasoning_content': null}, 'index': 0}]})}\n\n"
|
494 |
|
495 |
if delta.get("content") is not None:
|
496 |
if not first_reasoning_chunk:
|
497 |
reasoning_chunk = f"\n</think>\n"
|
498 |
-
yield f"data: {json.dumps({'choices': [{'delta': {'content': reasoning_chunk, 'reasoning_content': null}, 'index': 0}]})}\n\n"
|
499 |
first_reasoning_chunk = True
|
500 |
-
yield f"data: {json.dumps({'choices': [{'delta': {'content': delta["content"], 'reasoning_content': null}, 'index': 0}]})}\n\n"
|
501 |
|
502 |
except (KeyError, ValueError, json.JSONDecodeError) as e:
|
503 |
continue
|
|
|
490 |
if first_reasoning_chunk:
|
491 |
reasoning_chunk = f"<think>\n{reasoning_chunk}"
|
492 |
first_reasoning_chunk = False
|
493 |
+
yield f"data: {json.dumps({'choices': [{'delta': {'content': reasoning_chunk, 'reasoning_content': "null"}, 'index': 0}]})}\n\n"
|
494 |
|
495 |
if delta.get("content") is not None:
|
496 |
if not first_reasoning_chunk:
|
497 |
reasoning_chunk = f"\n</think>\n"
|
498 |
+
yield f"data: {json.dumps({'choices': [{'delta': {'content': reasoning_chunk, 'reasoning_content': "null"}, 'index': 0}]})}\n\n"
|
499 |
first_reasoning_chunk = True
|
500 |
+
yield f"data: {json.dumps({'choices': [{'delta': {'content': delta["content"], 'reasoning_content': "null"}, 'index': 0}]})}\n\n"
|
501 |
|
502 |
except (KeyError, ValueError, json.JSONDecodeError) as e:
|
503 |
continue
|