Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -949,7 +949,8 @@ def abacus_stream_generator(response, model: str, caching_info: Dict[str, Any]):
|
|
| 949 |
# Close playground code block if needed
|
| 950 |
if inside_code_block:
|
| 951 |
content_buffer += "\n```"
|
| 952 |
-
yield
|
|
|
|
| 953 |
|
| 954 |
# --- New Caching Logic ---
|
| 955 |
assistant_message = ChatMessage(role="assistant", content=content_buffer,
|
|
@@ -965,7 +966,7 @@ def abacus_stream_generator(response, model: str, caching_info: Dict[str, Any]):
|
|
| 965 |
|
| 966 |
# Send completion signal
|
| 967 |
log_debug("Sending completion signal")
|
| 968 |
-
yield
|
| 969 |
yield "data: [DONE]\n\n"
|
| 970 |
|
| 971 |
|
|
|
|
| 949 |
# Close playground code block if needed
|
| 950 |
if inside_code_block:
|
| 951 |
content_buffer += "\n```"
|
| 952 |
+
yield "data: " + StreamResponse(id=stream_id, created=created_time, model=model, choices=[StreamChoice(delta={'content': '\n```\n'})]).json() + "\n\n"
|
| 953 |
+
|
| 954 |
|
| 955 |
# --- New Caching Logic ---
|
| 956 |
assistant_message = ChatMessage(role="assistant", content=content_buffer,
|
|
|
|
| 966 |
|
| 967 |
# Send completion signal
|
| 968 |
log_debug("Sending completion signal")
|
| 969 |
+
yield "data: " + StreamResponse(id=stream_id, created=created_time, model=model, choices=[StreamChoice(delta={'stop': '\n```\n'})]).json() + "\n\n"
|
| 970 |
yield "data: [DONE]\n\n"
|
| 971 |
|
| 972 |
|