From a829a1ee56223b58f37d2e011e898ddff439f304 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sat, 2 Dec 2023 23:58:41 +0800 Subject: [PATCH] fix for janitorai --- koboldcpp.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/koboldcpp.py b/koboldcpp.py index bd6430affa99e..e2843a4e34602 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -540,7 +540,10 @@ def run_blocking(): #api format 1=basic,2=kai,3=oai,4=oai-chat async def send_oai_sse_event(self, data): - self.wfile.write(f'data: {data}\r\n\r\n'.encode()) + if data=="[DONE]": + self.wfile.write(f'data: {data}'.encode()) + else: + self.wfile.write(f'data: {data}\r\n\r\n'.encode()) self.wfile.flush() async def send_kai_sse_event(self, data): @@ -1918,8 +1921,8 @@ def tunnel_reader(): for x in found: tunneloutput = x - print(f"Your remote Kobold API can be found at {tunneloutput}/api/") - print(f"Your remote OpenAI Compatible API can be found at {tunneloutput}/v1/") + print(f"Your remote Kobold API can be found at {tunneloutput}/api") + print(f"Your remote OpenAI Compatible API can be found at {tunneloutput}/v1") print("======\n") print(f"Your remote tunnel is ready, please connect to {tunneloutput}") return