Update app.py
Browse files
app.py
CHANGED
|
@@ -506,7 +506,7 @@ def handsome_chat_completions():
|
|
| 506 |
completion_tokens = response_json["usage"]["completion_tokens"]
|
| 507 |
response_content = ""
|
| 508 |
|
| 509 |
-
if model_name == "deepseek-reasoner-
|
| 510 |
choice = response_json["choices"][0]
|
| 511 |
if "message" in choice:
|
| 512 |
if "reasoning_content" in choice["message"]:
|
|
@@ -526,8 +526,7 @@ def handsome_chat_completions():
|
|
| 526 |
if "reasoning_content" in choice["message"]:
|
| 527 |
response_content += f"<think>\n"
|
| 528 |
reasoning_content = choice["message"]["reasoning_content"]
|
| 529 |
-
|
| 530 |
-
response_content += formatted_reasoning
|
| 531 |
if "content" in choice["message"]:
|
| 532 |
response_content += choice["message"]["content"]
|
| 533 |
elif "choices" in response_json and len(response_json["choices"]) > 0:
|
|
|
|
| 506 |
completion_tokens = response_json["usage"]["completion_tokens"]
|
| 507 |
response_content = ""
|
| 508 |
|
| 509 |
+
if model_name == "deepseek-reasoner-thinking" and "choices" in response_json and len(response_json["choices"]) > 0:
|
| 510 |
choice = response_json["choices"][0]
|
| 511 |
if "message" in choice:
|
| 512 |
if "reasoning_content" in choice["message"]:
|
|
|
|
| 526 |
if "reasoning_content" in choice["message"]:
|
| 527 |
response_content += f"<think>\n"
|
| 528 |
reasoning_content = choice["message"]["reasoning_content"]
|
| 529 |
+
response_content += f"\n<\think>\n"
|
|
|
|
| 530 |
if "content" in choice["message"]:
|
| 531 |
response_content += choice["message"]["content"]
|
| 532 |
elif "choices" in response_json and len(response_json["choices"]) > 0:
|