SolsticeAI commited on
Commit
7a197ba
·
verified ·
1 Parent(s): c0c664c

Upload tokenizer

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. chat_template.jinja +91 -0
  3. tokenizer.json +3 -0
  4. tokenizer_config.json +39 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#- Training variant of the Qwen3 chat template (see qwen3.jinja for the original).
2
+ Modifications vs the original:
3
+ - Removed the loop.index0 > ns.last_query_index conditional; always include thinking block.
4
+ This makes the template prefix-preserving for the [user, assistant] → [user, assistant, tool] transition.
5
+ - Added {% generation %} / {% endgeneration %} around assistant message output to support
6
+ assistant-only loss masking in SFT training.
7
+ -#}
8
+ {%- if tools %}
9
+ {{- '<|im_start|>system\n' }}
10
+ {%- if messages[0].role == 'system' %}
11
+ {{- messages[0].content + '\n\n' }}
12
+ {%- endif %}
13
+ {{- "# 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>" }}
14
+ {%- for tool in tools %}
15
+ {{- "\n" }}
16
+ {{- tool | tojson }}
17
+ {%- endfor %}
18
+ {{- "\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" }}
19
+ {%- else %}
20
+ {%- if messages[0].role == 'system' %}
21
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
22
+ {%- endif %}
23
+ {%- endif %}
24
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
25
+ {%- for message in messages[::-1] %}
26
+ {%- set index = (messages|length - 1) - loop.index0 %}
27
+ {%- 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>')) %}
28
+ {%- set ns.multi_step_tool = false %}
29
+ {%- set ns.last_query_index = index %}
30
+ {%- endif %}
31
+ {%- endfor %}
32
+ {%- for message in messages %}
33
+ {%- if message.content is string %}
34
+ {%- set content = message.content %}
35
+ {%- else %}
36
+ {%- set content = '' %}
37
+ {%- endif %}
38
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
39
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
40
+ {%- elif message.role == "assistant" %}
41
+ {%- set reasoning_content = '' %}
42
+ {%- if message.reasoning_content is string %}
43
+ {%- set reasoning_content = message.reasoning_content %}
44
+ {%- else %}
45
+ {%- if '</think>' in content %}
46
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
47
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
48
+ {%- endif %}
49
+ {%- endif %}
50
+ {{- '<|im_start|>' + message.role + '\n' }}
51
+ {%- generation %}
52
+ {{- '<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
53
+ {%- if message.tool_calls %}
54
+ {%- for tool_call in message.tool_calls %}
55
+ {%- if (loop.first and content) or (not loop.first) %}
56
+ {{- '\n' }}
57
+ {%- endif %}
58
+ {%- if tool_call.function %}
59
+ {%- set tool_call = tool_call.function %}
60
+ {%- endif %}
61
+ {{- '<tool_call>\n{"name": "' }}
62
+ {{- tool_call.name }}
63
+ {{- '", "arguments": ' }}
64
+ {%- if tool_call.arguments is string %}
65
+ {{- tool_call.arguments }}
66
+ {%- else %}
67
+ {{- tool_call.arguments | tojson }}
68
+ {%- endif %}
69
+ {{- '}\n</tool_call>' }}
70
+ {%- endfor %}
71
+ {%- endif %}
72
+ {{- '<|im_end|>\n' }}
73
+ {%- endgeneration %}
74
+ {%- elif message.role == "tool" %}
75
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
76
+ {{- '<|im_start|>user' }}
77
+ {%- endif %}
78
+ {{- '\n<tool_response>\n' }}
79
+ {{- content }}
80
+ {{- '\n</tool_response>' }}
81
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
82
+ {{- '<|im_end|>\n' }}
83
+ {%- endif %}
84
+ {%- endif %}
85
+ {%- endfor %}
86
+ {%- if add_generation_prompt %}
87
+ {{- '<|im_start|>assistant\n' }}
88
+ {%- if enable_thinking is defined and enable_thinking is false %}
89
+ {{- '<think>\n\n</think>\n\n' }}
90
+ {%- endif %}
91
+ {%- endif %}
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79cb3c783570f1b8fe73b9ed530ae50cae9ce4b6344c0b5edefc50478847eaa4
3
+ size 11422817
tokenizer_config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "auto_dna_tags": true,
4
+ "auto_map": {
5
+ "AutoTokenizer": [
6
+ "tokenizer.HybridDNATokenizer",
7
+ null
8
+ ]
9
+ },
10
+ "backend": "tokenizers",
11
+ "bos_token": null,
12
+ "clean_up_tokenization_spaces": false,
13
+ "eos_token": "<|im_end|>",
14
+ "errors": "replace",
15
+ "extra_special_tokens": [
16
+ "<|im_start|>",
17
+ "<|im_end|>",
18
+ "<|object_ref_start|>",
19
+ "<|object_ref_end|>",
20
+ "<|box_start|>",
21
+ "<|box_end|>",
22
+ "<|quad_start|>",
23
+ "<|quad_end|>",
24
+ "<|vision_start|>",
25
+ "<|vision_end|>",
26
+ "<|vision_pad|>",
27
+ "<|image_pad|>",
28
+ "<|video_pad|>"
29
+ ],
30
+ "is_local": false,
31
+ "k": 6,
32
+ "local_files_only": false,
33
+ "model_max_length": 131072,
34
+ "pad_token": "<|endoftext|>",
35
+ "split_special_tokens": false,
36
+ "tail": "pad_n",
37
+ "tokenizer_class": "TokenizersBackend",
38
+ "unk_token": null
39
+ }