Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -190,7 +190,7 @@ def verify_admin_password(password):
|
|
| 190 |
|
| 191 |
def fix_malformed_json(json_str):
|
| 192 |
"""Fix the malformed JSON from upstream server"""
|
| 193 |
-
try:
|
| 194 |
# The upstream sends: {"choices":[{"delta":{"content":"text"},"index":0}],"created":123,"id":"chatcmpl-abc"123,"model":"gpt-5-nano","object":"chat.completion.chunk"}
|
| 195 |
# We need to fix it to: {"choices":[{"delta":{"content":"text"},"index":0}],"created":123,"id":"chatcmpl-abc","model":"gpt-5-nano","object":"chat.completion.chunk"}
|
| 196 |
|
|
|
|
| 190 |
|
| 191 |
def fix_malformed_json(json_str):
|
| 192 |
"""Fix the malformed JSON from upstream server"""
|
| 193 |
+
try:
|
| 194 |
# The upstream sends: {"choices":[{"delta":{"content":"text"},"index":0}],"created":123,"id":"chatcmpl-abc"123,"model":"gpt-5-nano","object":"chat.completion.chunk"}
|
| 195 |
# We need to fix it to: {"choices":[{"delta":{"content":"text"},"index":0}],"created":123,"id":"chatcmpl-abc","model":"gpt-5-nano","object":"chat.completion.chunk"}
|
| 196 |
|