mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 01:05:09 +02:00
fixed a sse stream issue
This commit is contained in:
+3
-1
@@ -70,7 +70,7 @@ dry_seq_break_max = 128
|
||||
extra_images_max = 4 # for kontext/qwen img
|
||||
|
||||
# global vars
|
||||
KcppVersion = "1.109"
|
||||
KcppVersion = "1.109.1"
|
||||
showdebug = True
|
||||
kcpp_instance = None #global running instance
|
||||
global_memory = {"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_config_target":""}
|
||||
@@ -3678,6 +3678,8 @@ class KcppServerRequestHandler(http.server.SimpleHTTPRequestHandler):
|
||||
event_str = json.dumps({"token": tokenStr, "finish_reason":None})
|
||||
await self.send_kai_sse_event(event_str)
|
||||
tokenStr = "" # now the final finish reason can be sent alone
|
||||
if delta and 'role' in delta:
|
||||
delta = {'role':delta["role"],'content':''}
|
||||
if api_format == 4: # if oai chat, set format to expected openai streaming response
|
||||
if streamDone and ("logprobs" in genparams and genparams["logprobs"]): # this is a hack that sends an extra message containing ALL the logprobs
|
||||
lastlogprobs = handle.last_logprobs()
|
||||
|
||||
Reference in New Issue
Block a user