Upload 6 files
Browse files- chat_template.jinja +74 -0
- config.json +6 -4
- generation_config.json +1 -1
- model.safetensors +2 -2
- tokenizer_config.json +5 -30
chat_template.jinja
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0].role == 'system' %}
|
| 4 |
+
{{- messages[0].content + '\n\n' }}
|
| 5 |
+
{%- endif %}
|
| 6 |
+
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 7 |
+
{%- for tool in tools %}
|
| 8 |
+
{{- "\n" }}
|
| 9 |
+
{{- tool | tojson }}
|
| 10 |
+
{%- endfor %}
|
| 11 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 12 |
+
{%- else %}
|
| 13 |
+
{%- if messages[0]['role'] == 'system' -%}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 15 |
+
{%- else -%}
|
| 16 |
+
{{- '<|im_start|>system\nYou are a helpful assistant<|im_end|>\n' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{%- endif %}
|
| 19 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 20 |
+
{%- for message in messages[::-1] %}
|
| 21 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 22 |
+
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 23 |
+
{%- set ns.multi_step_tool = false %}
|
| 24 |
+
{%- set ns.last_query_index = index %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- endfor %}
|
| 27 |
+
{%- for message in messages %}
|
| 28 |
+
{%- if message.content is string %}
|
| 29 |
+
{%- set content = message.content %}
|
| 30 |
+
{%- else %}
|
| 31 |
+
{%- set content = '' %}
|
| 32 |
+
{%- endif %}
|
| 33 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 34 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 35 |
+
{%- elif message.role == "assistant" %}
|
| 36 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 37 |
+
{%- if message.tool_calls %}
|
| 38 |
+
{%- for tool_call in message.tool_calls %}
|
| 39 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 40 |
+
{{- '\n' }}
|
| 41 |
+
{%- endif %}
|
| 42 |
+
{%- if tool_call.function %}
|
| 43 |
+
{%- set tool_call = tool_call.function %}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 46 |
+
{{- tool_call.name }}
|
| 47 |
+
{{- '", "arguments": ' }}
|
| 48 |
+
{%- if tool_call.arguments is string %}
|
| 49 |
+
{{- tool_call.arguments }}
|
| 50 |
+
{%- else %}
|
| 51 |
+
{{- tool_call.arguments | tojson }}
|
| 52 |
+
{%- endif %}
|
| 53 |
+
{{- '}\n</tool_call>' }}
|
| 54 |
+
{%- endfor %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{{- '<|im_end|>\n' }}
|
| 57 |
+
{%- elif message.role == "tool" %}
|
| 58 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 59 |
+
{{- '<|im_start|>user' }}
|
| 60 |
+
{%- endif %}
|
| 61 |
+
{{- '\n<tool_response>\n' }}
|
| 62 |
+
{{- content }}
|
| 63 |
+
{{- '\n</tool_response>' }}
|
| 64 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 65 |
+
{{- '<|im_end|>\n' }}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{%- endif %}
|
| 68 |
+
{%- endfor %}
|
| 69 |
+
{%- if add_generation_prompt %}
|
| 70 |
+
{{- '<|im_start|>assistant\n' }}
|
| 71 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 72 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{%- endif %}
|
config.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 1,
|
|
|
|
| 8 |
"eos_token_id": 2,
|
| 9 |
"head_dim": 96,
|
| 10 |
"hidden_act": "silu",
|
|
@@ -19,11 +20,12 @@
|
|
| 19 |
"num_key_value_heads": 2,
|
| 20 |
"pretraining_tp": 1,
|
| 21 |
"rms_norm_eps": 1e-05,
|
| 22 |
-
"
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
"tie_word_embeddings": true,
|
| 25 |
-
"
|
| 26 |
-
"transformers_version": "4.51.3",
|
| 27 |
"use_cache": true,
|
| 28 |
"vocab_size": 6400
|
| 29 |
}
|
|
|
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 1,
|
| 8 |
+
"dtype": "float16",
|
| 9 |
"eos_token_id": 2,
|
| 10 |
"head_dim": 96,
|
| 11 |
"hidden_act": "silu",
|
|
|
|
| 20 |
"num_key_value_heads": 2,
|
| 21 |
"pretraining_tp": 1,
|
| 22 |
"rms_norm_eps": 1e-05,
|
| 23 |
+
"rope_parameters": {
|
| 24 |
+
"rope_theta": 1000000.0,
|
| 25 |
+
"rope_type": "default"
|
| 26 |
+
},
|
| 27 |
"tie_word_embeddings": true,
|
| 28 |
+
"transformers_version": "5.0.0rc0",
|
|
|
|
| 29 |
"use_cache": true,
|
| 30 |
"vocab_size": 6400
|
| 31 |
}
|
generation_config.json
CHANGED
|
@@ -2,5 +2,5 @@
|
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
-
"transformers_version": "
|
| 6 |
}
|
|
|
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
+
"transformers_version": "5.0.0rc0"
|
| 6 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:71d2a54d625bb1a91bcde6a146f1bc32afe62ea1f7d067a8ffe4ee7dc810dee4
|
| 3 |
+
size 208078080
|
tokenizer_config.json
CHANGED
|
@@ -2,43 +2,18 @@
|
|
| 2 |
"add_bos_token": false,
|
| 3 |
"add_eos_token": false,
|
| 4 |
"add_prefix_space": false,
|
| 5 |
-
"
|
| 6 |
-
|
| 7 |
-
"content": "<|endoftext|>",
|
| 8 |
-
"lstrip": false,
|
| 9 |
-
"normalized": false,
|
| 10 |
-
"rstrip": false,
|
| 11 |
-
"single_word": false,
|
| 12 |
-
"special": true
|
| 13 |
-
},
|
| 14 |
-
"1": {
|
| 15 |
-
"content": "<|im_start|>",
|
| 16 |
-
"lstrip": false,
|
| 17 |
-
"normalized": false,
|
| 18 |
-
"rstrip": false,
|
| 19 |
-
"single_word": false,
|
| 20 |
-
"special": true
|
| 21 |
-
},
|
| 22 |
-
"2": {
|
| 23 |
-
"content": "<|im_end|>",
|
| 24 |
-
"lstrip": false,
|
| 25 |
-
"normalized": false,
|
| 26 |
-
"rstrip": false,
|
| 27 |
-
"single_word": false,
|
| 28 |
-
"special": true
|
| 29 |
-
}
|
| 30 |
-
},
|
| 31 |
-
"additional_special_tokens": [],
|
| 32 |
"bos_token": "<|im_start|>",
|
| 33 |
-
"chat_template": "{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{{ '<|im_start|>system\\n' + system_message + '<|im_end|>\\n' }}{% else %}{{ '<|im_start|>system\\nYou are a helpful assistant<|im_end|>\\n' }}{% endif %}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|im_start|>user\\n' + content + '<|im_end|>\\n<|im_start|>assistant\\n' }}{% elif message['role'] == 'assistant' %}{{ content + '<|im_end|>' + '\\n' }}{% endif %}{% endfor %}",
|
| 34 |
"clean_up_tokenization_spaces": false,
|
| 35 |
"eos_token": "<|im_end|>",
|
| 36 |
-
"extra_special_tokens":
|
|
|
|
| 37 |
"legacy": true,
|
| 38 |
"model_max_length": 32768,
|
| 39 |
"pad_token": "<|endoftext|>",
|
| 40 |
"sp_model_kwargs": {},
|
| 41 |
"spaces_between_special_tokens": false,
|
| 42 |
-
"tokenizer_class": "
|
| 43 |
"unk_token": "<|endoftext|>"
|
| 44 |
}
|
|
|
|
| 2 |
"add_bos_token": false,
|
| 3 |
"add_eos_token": false,
|
| 4 |
"add_prefix_space": false,
|
| 5 |
+
"additional_special_tokens": null,
|
| 6 |
+
"backend": "tokenizers",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
"bos_token": "<|im_start|>",
|
|
|
|
| 8 |
"clean_up_tokenization_spaces": false,
|
| 9 |
"eos_token": "<|im_end|>",
|
| 10 |
+
"extra_special_tokens": [],
|
| 11 |
+
"is_local": true,
|
| 12 |
"legacy": true,
|
| 13 |
"model_max_length": 32768,
|
| 14 |
"pad_token": "<|endoftext|>",
|
| 15 |
"sp_model_kwargs": {},
|
| 16 |
"spaces_between_special_tokens": false,
|
| 17 |
+
"tokenizer_class": "TokenizersBackend",
|
| 18 |
"unk_token": "<|endoftext|>"
|
| 19 |
}
|