Skip to content

Commit

Permalink
fix for janitorai
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed Dec 2, 2023
1 parent 12f66ea commit a829a1e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions koboldcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a829a1e

Please sign in to comment.