From ea1f88dd293c0c961f98297f8d9aba7e8cf48ce3 Mon Sep 17 00:00:00 2001 From: khimaros Date: Thu, 15 Feb 2024 20:20:13 +0000 Subject: [PATCH] fix: Use '\n' seperator for EventSourceResponse (#1188) this fixes compatibility with some OpenAI clients, including BetterChatGPT (https://github.com/ztjhz/BetterChatGPT/issues/537). Co-authored-by: Andrei --- llama_cpp/server/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llama_cpp/server/app.py b/llama_cpp/server/app.py index 368022c..7a1391d 100644 --- a/llama_cpp/server/app.py +++ b/llama_cpp/server/app.py @@ -290,6 +290,7 @@ async def create_completion( inner_send_chan=send_chan, iterator=iterator(), ), + sep='\n', ) else: return iterator_or_completion @@ -382,6 +383,7 @@ async def create_chat_completion( inner_send_chan=send_chan, iterator=iterator(), ), + sep='\n', ) else: return iterator_or_completion