Skip to content

Commit 5d35193

Browse files
committed
fixed a sse stream issue
1 parent 7df2108 commit 5d35193

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

koboldcpp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
extra_images_max = 4 # for kontext/qwen img
7171

7272
# global vars
73-
KcppVersion = "1.109"
73+
KcppVersion = "1.109.1"
7474
showdebug = True
7575
kcpp_instance = None #global running instance
7676
global_memory = {"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_config_target":""}
@@ -3678,6 +3678,8 @@ async def handle_sse_stream(self, genparams, api_format):
36783678
event_str = json.dumps({"token": tokenStr, "finish_reason":None})
36793679
await self.send_kai_sse_event(event_str)
36803680
tokenStr = "" # now the final finish reason can be sent alone
3681+
if delta and 'role' in delta:
3682+
delta = {'role':delta["role"],'content':''}
36813683
if api_format == 4: # if oai chat, set format to expected openai streaming response
36823684
if streamDone and ("logprobs" in genparams and genparams["logprobs"]): # this is a hack that sends an extra message containing ALL the logprobs
36833685
lastlogprobs = handle.last_logprobs()

0 commit comments

Comments
 (0)