Skip to content

Commit 12e5b8a

Browse files
committed
try fix owui
1 parent 0ed95fc commit 12e5b8a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

koboldcpp.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3206,10 +3206,8 @@ def do_POST(self):
32063206
toolsdata_res[0]["index"] = 0 # need to add an index for OWUI
32073207
except Exception:
32083208
toolsdata_res = []
3209-
toolsdata_p1 = json.dumps({"id":"koboldcpp","object":"chat.completion.chunk","created":int(time.time()),"model":friendlymodelname,"choices":[{"index":0,"finish_reason":None,"delta":{'role':'assistant','content':None, "tool_calls":toolsdata_res}}]})
3210-
toolsdata_p2 = json.dumps({"id":"koboldcpp","object":"chat.completion.chunk","created":int(time.time()),"model":friendlymodelname,"choices":[{"index":0,"finish_reason":"tool_calls","delta":{}}]})
3209+
toolsdata_p1 = json.dumps({"id":"koboldcpp","object":"chat.completion.chunk","created":int(time.time()),"model":friendlymodelname,"choices":[{"index":0,"finish_reason":"tool_calls","delta":{'role':'assistant','content':None, "tool_calls":toolsdata_res}}]})
32113210
self.wfile.write(f'data: {toolsdata_p1}\n\n'.encode())
3212-
self.wfile.write(f'data: {toolsdata_p2}\n\n'.encode())
32133211
self.wfile.write('data: [DONE]'.encode())
32143212
self.wfile.flush()
32153213
self.close_connection = True

0 commit comments

Comments
 (0)