fixed l3 template, add index

This commit is contained in:
Concedo 2025-03-31 23:59:06 +08:00
parent 1ebadc515e
commit 0ed95fcccc
2 changed files with 3 additions and 1 deletions

View file

@ -53,7 +53,7 @@
"assistant_end": "<end_of_turn>\n"
}
}, {
"search": ["<|start_header_id|>system"],
"search": ["<|start_header_id|>assistant<|end_header_id|>"],
"name": "Llama 3.x.",
"adapter": {
"system_start": "<|start_header_id|>system<|end_header_id|>\n\n",

View file

@ -3202,6 +3202,8 @@ Enter Prompt:<br>
toolsdata_res = []
try:
toolsdata_res = gen['choices'][0]['message']['tool_calls']
if toolsdata_res and len(toolsdata_res)>0:
toolsdata_res[0]["index"] = 0 # need to add an index for OWUI
except Exception:
toolsdata_res = []
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}}]})