Spaces:
Runtime error
Runtime error
Update server.py
Browse files
server.py
CHANGED
|
@@ -438,8 +438,9 @@ class AsyncUpstreamClient:
|
|
| 438 |
try:
|
| 439 |
data_json = line.split('data: ')[1]
|
| 440 |
except:
|
|
|
|
| 441 |
print("ERROR0")
|
| 442 |
-
print(line)
|
| 443 |
try:
|
| 444 |
data = json.loads(data_json)
|
| 445 |
except:
|
|
@@ -447,8 +448,9 @@ class AsyncUpstreamClient:
|
|
| 447 |
continue
|
| 448 |
else:
|
| 449 |
print("ERROR1")
|
| 450 |
-
|
| 451 |
-
print(
|
|
|
|
| 452 |
try:
|
| 453 |
if data['choices'][0]['delta']['reasoning']:
|
| 454 |
if not RES:
|
|
@@ -468,8 +470,9 @@ class AsyncUpstreamClient:
|
|
| 468 |
yield orjson.dumps({"response": data['choices'][0]['delta']['content']}) + b"\n"
|
| 469 |
|
| 470 |
except:
|
| 471 |
-
|
| 472 |
-
print(
|
|
|
|
| 473 |
# yield orjson.dumps({"response": "okk\n"}) + b"\n"
|
| 474 |
|
| 475 |
class ChatService:
|
|
|
|
| 438 |
try:
|
| 439 |
data_json = line.split('data: ')[1]
|
| 440 |
except:
|
| 441 |
+
pass
|
| 442 |
print("ERROR0")
|
| 443 |
+
# print(line)
|
| 444 |
try:
|
| 445 |
data = json.loads(data_json)
|
| 446 |
except:
|
|
|
|
| 448 |
continue
|
| 449 |
else:
|
| 450 |
print("ERROR1")
|
| 451 |
+
pass
|
| 452 |
+
# print(data_json)
|
| 453 |
+
# print(len(data_json))
|
| 454 |
try:
|
| 455 |
if data['choices'][0]['delta']['reasoning']:
|
| 456 |
if not RES:
|
|
|
|
| 470 |
yield orjson.dumps({"response": data['choices'][0]['delta']['content']}) + b"\n"
|
| 471 |
|
| 472 |
except:
|
| 473 |
+
pass
|
| 474 |
+
# print("ERROR2")
|
| 475 |
+
# print(data)
|
| 476 |
# yield orjson.dumps({"response": "okk\n"}) + b"\n"
|
| 477 |
|
| 478 |
class ChatService:
|