mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-08 06:33:51 +01:00
API: Use \n instead of \r\n as the SSE separator to match OpenAI
This commit is contained in:
parent
8be444a559
commit
f06583b2b9
|
|
@ -125,7 +125,7 @@ async def openai_completions(request: Request, request_data: CompletionRequest):
|
|||
stop_event.set()
|
||||
response.close()
|
||||
|
||||
return EventSourceResponse(generator()) # SSE streaming
|
||||
return EventSourceResponse(generator(), sep="\n") # SSE streaming
|
||||
|
||||
else:
|
||||
stop_event = threading.Event()
|
||||
|
|
@ -160,7 +160,7 @@ async def openai_chat_completions(request: Request, request_data: ChatCompletion
|
|||
stop_event.set()
|
||||
response.close()
|
||||
|
||||
return EventSourceResponse(generator()) # SSE streaming
|
||||
return EventSourceResponse(generator(), sep="\n") # SSE streaming
|
||||
|
||||
else:
|
||||
stop_event = threading.Event()
|
||||
|
|
|
|||
Loading…
Reference in a new issue