Skip to content

Commit

Permalink
fix: Use '\n' seperator for EventSourceResponse (#1188)
Browse files Browse the repository at this point in the history
this fixes compatibility with some OpenAI clients, including BetterChatGPT (ztjhz/BetterChatGPT#537).

Co-authored-by: Andrei <abetlen@gmail.com>
  • Loading branch information
khimaros and abetlen authored Feb 15, 2024
1 parent a5cfeb7 commit ea1f88d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llama_cpp/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def iterator() -> Iterator[llama_cpp.CreateCompletionStreamResponse]:
inner_send_chan=send_chan,
iterator=iterator(),
),
sep='\n',
)
else:
return iterator_or_completion
Expand Down Expand Up @@ -382,6 +383,7 @@ def iterator() -> Iterator[llama_cpp.ChatCompletionChunk]:
inner_send_chan=send_chan,
iterator=iterator(),
),
sep='\n',
)
else:
return iterator_or_completion
Expand Down

0 comments on commit ea1f88d

Please sign in to comment.