Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4b0e332

Browse filesBrowse files
committed
fix: minor formatting bugs for chatml-function-calling
1 parent 6fe8b42 commit 4b0e332
Copy full SHA for 4b0e332

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎llama_cpp/llama_chat_format.py

Copy file name to clipboardExpand all lines: llama_cpp/llama_chat_format.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2072,12 +2072,14 @@ def chatml_function_calling(
20722072
"{% if message.role == 'assistant' %}"
20732073
## Reglar message
20742074
"{% if message.content and message.content | length > 0 %}"
2075+
"{% if tool_calls %}"
20752076
"message:\n"
2077+
"{% endif %}"
20762078
"{{ message.content }}"
20772079
"\n<|im_end|>\n"
20782080
"{% endif %}"
20792081
## Function calls
2080-
"{% if message.tool_calls %}"
2082+
"{% if 'tool_calls' in message %}"
20812083
"{% for tool_call in message.tool_calls %}"
20822084
"functions.{{ tool_call.function.name }}:\n"
20832085
"{{ tool_call.function.arguments }}"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.