(Trained with Unsloth)
Browse files- chat_template.jinja +139 -0
- config.json +29 -0
- generation_config.json +8 -0
- special_tokens_map.json +24 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +45 -0
chat_template.jinja
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{{- bos_token }}
|
2 |
+
{%- if custom_tools is defined %}
|
3 |
+
{%- set tools = custom_tools %}
|
4 |
+
{%- endif %}
|
5 |
+
{%- if not tools_in_user_message is defined %}
|
6 |
+
{%- set tools_in_user_message = true %}
|
7 |
+
{%- endif %}
|
8 |
+
{%- if not date_string is defined %}
|
9 |
+
{%- set date_string = "26 July 2024" %}
|
10 |
+
{%- endif %}
|
11 |
+
{%- if not tools is defined %}
|
12 |
+
{%- set tools = none %}
|
13 |
+
{%- endif %}
|
14 |
+
|
15 |
+
{#- This block extracts the system message, so we can slot it into the right place. #}
|
16 |
+
{%- if messages[0]['role'] == 'system' %}
|
17 |
+
{%- set system_message = messages[0]['content'] %}
|
18 |
+
{%- set messages = messages[1:] %}
|
19 |
+
{%- else %}
|
20 |
+
{%- set system_message = "" %}
|
21 |
+
{%- endif %}
|
22 |
+
|
23 |
+
{#- System message + builtin tools #}
|
24 |
+
{{- "<|start_header_id|>system<|end_header_id|>
|
25 |
+
|
26 |
+
" }}
|
27 |
+
{%- if builtin_tools is defined or tools is not none %}
|
28 |
+
{{- "Environment: ipython
|
29 |
+
" }}
|
30 |
+
{%- endif %}
|
31 |
+
{%- if builtin_tools is defined %}
|
32 |
+
{{- "Tools: " + builtin_tools | reject('equalto', 'code_interpreter') | join(", ") + "
|
33 |
+
|
34 |
+
"}}
|
35 |
+
{%- endif %}
|
36 |
+
{{- "Cutting Knowledge Date: December 2023
|
37 |
+
" }}
|
38 |
+
{{- "Today Date: " + date_string + "
|
39 |
+
|
40 |
+
" }}
|
41 |
+
{%- if tools is not none and not tools_in_user_message %}
|
42 |
+
{{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
|
43 |
+
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
|
44 |
+
{{- "Do not use variables.
|
45 |
+
|
46 |
+
" }}
|
47 |
+
{%- for t in tools %}
|
48 |
+
{{- t | tojson(indent=4) }}
|
49 |
+
{{- "
|
50 |
+
|
51 |
+
" }}
|
52 |
+
{%- endfor %}
|
53 |
+
{%- endif %}
|
54 |
+
{{- system_message }}
|
55 |
+
{{- "<|eot_id|>" }}
|
56 |
+
|
57 |
+
{#- Custom tools are passed in a user message with some extra guidance #}
|
58 |
+
{%- if tools_in_user_message and not tools is none %}
|
59 |
+
{#- Extract the first user message so we can plug it in here #}
|
60 |
+
{%- if messages | length != 0 %}
|
61 |
+
{%- set first_user_message = messages[0]['content'] %}
|
62 |
+
{%- set messages = messages[1:] %}
|
63 |
+
{%- else %}
|
64 |
+
{{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
|
65 |
+
{%- endif %}
|
66 |
+
{{- '<|start_header_id|>user<|end_header_id|>
|
67 |
+
|
68 |
+
' -}}
|
69 |
+
{{- "Given the following functions, please respond with a JSON for a function call " }}
|
70 |
+
{{- "with its proper arguments that best answers the given prompt.
|
71 |
+
|
72 |
+
" }}
|
73 |
+
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
|
74 |
+
{{- "Do not use variables.
|
75 |
+
|
76 |
+
" }}
|
77 |
+
{%- for t in tools %}
|
78 |
+
{{- t | tojson(indent=4) }}
|
79 |
+
{{- "
|
80 |
+
|
81 |
+
" }}
|
82 |
+
{%- endfor %}
|
83 |
+
{{- first_user_message + "<|eot_id|>"}}
|
84 |
+
{%- endif %}
|
85 |
+
|
86 |
+
{%- for message in messages %}
|
87 |
+
{%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
|
88 |
+
{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>
|
89 |
+
|
90 |
+
'+ message['content'] + '<|eot_id|>' }}
|
91 |
+
{%- elif 'tool_calls' in message %}
|
92 |
+
{%- if not message.tool_calls|length == 1 %}
|
93 |
+
{{- raise_exception("This model only supports single tool-calls at once!") }}
|
94 |
+
{%- endif %}
|
95 |
+
{%- set tool_call = message.tool_calls[0].function %}
|
96 |
+
{%- if builtin_tools is defined and tool_call.name in builtin_tools %}
|
97 |
+
{{- '<|start_header_id|>assistant<|end_header_id|>
|
98 |
+
|
99 |
+
' -}}
|
100 |
+
{{- "<|python_tag|>" + tool_call.name + ".call(" }}
|
101 |
+
{%- for arg_name, arg_val in tool_call.arguments | items %}
|
102 |
+
{{- arg_name + '="' + arg_val + '"' }}
|
103 |
+
{%- if not loop.last %}
|
104 |
+
{{- ", " }}
|
105 |
+
{%- endif %}
|
106 |
+
{%- endfor %}
|
107 |
+
{{- ")" }}
|
108 |
+
{%- else %}
|
109 |
+
{{- '<|start_header_id|>assistant<|end_header_id|>
|
110 |
+
|
111 |
+
' -}}
|
112 |
+
{{- '{"name": "' + tool_call.name + '", ' }}
|
113 |
+
{{- '"parameters": ' }}
|
114 |
+
{{- tool_call.arguments | tojson }}
|
115 |
+
{{- "}" }}
|
116 |
+
{%- endif %}
|
117 |
+
{%- if builtin_tools is defined %}
|
118 |
+
{#- This means we're in ipython mode #}
|
119 |
+
{{- "<|eom_id|>" }}
|
120 |
+
{%- else %}
|
121 |
+
{{- "<|eot_id|>" }}
|
122 |
+
{%- endif %}
|
123 |
+
{%- elif message.role == "tool" or message.role == "ipython" %}
|
124 |
+
{{- "<|start_header_id|>ipython<|end_header_id|>
|
125 |
+
|
126 |
+
" }}
|
127 |
+
{%- if message.content is mapping or message.content is iterable %}
|
128 |
+
{{- message.content | tojson }}
|
129 |
+
{%- else %}
|
130 |
+
{{- message.content }}
|
131 |
+
{%- endif %}
|
132 |
+
{{- "<|eot_id|>" }}
|
133 |
+
{%- endif %}
|
134 |
+
{%- endfor %}
|
135 |
+
{%- if add_generation_prompt %}
|
136 |
+
{{- '<|start_header_id|>assistant<|end_header_id|>
|
137 |
+
|
138 |
+
' }}
|
139 |
+
{%- endif %}
|
config.json
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"MistralForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_dropout": 0.0,
|
6 |
+
"bos_token_id": 1,
|
7 |
+
"eos_token_id": 2,
|
8 |
+
"head_dim": null,
|
9 |
+
"hidden_act": "silu",
|
10 |
+
"hidden_size": 4096,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 14336,
|
13 |
+
"max_position_embeddings": 32768,
|
14 |
+
"model_type": "mistral",
|
15 |
+
"num_attention_heads": 32,
|
16 |
+
"num_hidden_layers": 32,
|
17 |
+
"num_key_value_heads": 8,
|
18 |
+
"pad_token_id": 0,
|
19 |
+
"rms_norm_eps": 1e-05,
|
20 |
+
"rope_scaling": null,
|
21 |
+
"rope_theta": 1000000.0,
|
22 |
+
"sliding_window": null,
|
23 |
+
"tie_word_embeddings": false,
|
24 |
+
"torch_dtype": "bfloat16",
|
25 |
+
"transformers_version": "4.53.2",
|
26 |
+
"unsloth_version": "2025.7.8",
|
27 |
+
"use_cache": true,
|
28 |
+
"vocab_size": 32000
|
29 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"max_length": 32768,
|
6 |
+
"pad_token_id": 0,
|
7 |
+
"transformers_version": "4.53.2"
|
8 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": "<unk>",
|
17 |
+
"unk_token": {
|
18 |
+
"content": "<unk>",
|
19 |
+
"lstrip": false,
|
20 |
+
"normalized": false,
|
21 |
+
"rstrip": false,
|
22 |
+
"single_word": false
|
23 |
+
}
|
24 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
|
3 |
+
size 493443
|
tokenizer_config.json
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
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": "<s>",
|
33 |
+
"clean_up_tokenization_spaces": false,
|
34 |
+
"eos_token": "</s>",
|
35 |
+
"extra_special_tokens": {},
|
36 |
+
"legacy": true,
|
37 |
+
"model_max_length": 32768,
|
38 |
+
"pad_token": "<unk>",
|
39 |
+
"padding_side": "right",
|
40 |
+
"sp_model_kwargs": {},
|
41 |
+
"spaces_between_special_tokens": false,
|
42 |
+
"tokenizer_class": "LlamaTokenizer",
|
43 |
+
"unk_token": "<unk>",
|
44 |
+
"use_default_system_prompt": false
|
45 |
+
}
|