Update app.py
Browse files
app.py
CHANGED
@@ -543,12 +543,10 @@ def handsome_chat_completions():
|
|
543 |
choice = response_json["choices"][0]
|
544 |
if "message" in choice:
|
545 |
if "reasoning_content" in choice["message"]:
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
first_reasoning_chunk = False
|
551 |
-
formatted_reasoning = f"```Thinking\n{choice['message']['reasoning_chunk']}\n```"
|
552 |
response_content += formatted_reasoning + "\n"
|
553 |
if "content" in choice["message"]:
|
554 |
response_content += choice["message"]["content"]
|
@@ -652,4 +650,4 @@ if __name__ == '__main__':
|
|
652 |
debug=False,
|
653 |
host='0.0.0.0',
|
654 |
port=int(os.environ.get('PORT', 7860))
|
655 |
-
)
|
|
|
543 |
choice = response_json["choices"][0]
|
544 |
if "message" in choice:
|
545 |
if "reasoning_content" in choice["message"]:
|
546 |
+
reasoning_content = choice["message"]["reasoning_content"]
|
547 |
+
reasoning_content = reasoning_content.replace('\n', '\n> ')
|
548 |
+
reasoning_content = '> ' + reasoning_content
|
549 |
+
formatted_reasoning = f"{reasoning_content_variable}\n"
|
|
|
|
|
550 |
response_content += formatted_reasoning + "\n"
|
551 |
if "content" in choice["message"]:
|
552 |
response_content += choice["message"]["content"]
|
|
|
650 |
debug=False,
|
651 |
host='0.0.0.0',
|
652 |
port=int(os.environ.get('PORT', 7860))
|
653 |
+
)
|