neuralnets commited on
Commit
903c6fd
·
verified ·
1 Parent(s): 639aadb

Upload tokenizer

Browse files
.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,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- '[@BOS@]\n' }}
2
+ {%- if tools -%}
3
+ <|start_of_turn|><|tool_declare|>
4
+ <tools>
5
+ {% for tool in tools %}
6
+ {{ tool | tojson(ensure_ascii=False) }}
7
+ {% endfor %}
8
+ </tools>
9
+ {{- '<|end_of_turn|>\n' }}{%- endif -%}
10
+ {%- macro visible_text(content) -%}
11
+ {%- if content is string -%}
12
+ {{- content }}
13
+ {%- elif content is iterable and content is not mapping -%}
14
+ {%- for item in content -%}
15
+ {%- if item is mapping and item.type == 'text' -%}
16
+ {{- item.text }}
17
+ {%- elif item is string -%}
18
+ {{- item }}
19
+ {%- endif -%}
20
+ {%- endfor -%}
21
+ {%- elif content is none -%}
22
+ {{- '' }}
23
+ {%- else -%}
24
+ {{- content }}
25
+ {%- endif -%}
26
+ {%- endmacro -%}
27
+ {%- set ns = namespace(last_user_index=-1) %}
28
+ {%- for m in messages %}
29
+ {%- if m.role == 'user' %}
30
+ {% set ns.last_user_index = loop.index0 -%}
31
+ {%- endif %}
32
+ {%- endfor %}
33
+ {% for m in messages %}
34
+ {%- if m.role == 'user' -%}<|start_of_turn|><|user|>
35
+ {{ visible_text(m.content) }}
36
+ {{- '<|nothink|>' if (enable_thinking is defined and not enable_thinking and not visible_text(m.content).endswith("<|nothink|>")) else '' -}}
37
+ {{- '<|end_of_turn|>\n' }}
38
+ {%- elif m.role == 'assistant' -%}
39
+ {{- '<|start_of_turn|><|assistant|>\n' }}
40
+ {%- set reasoning_content = '' %}
41
+ {%- set content = visible_text(m.content) %}
42
+ {%- if m.reasoning_content is string %}
43
+ {%- set reasoning_content = m.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
+ {%- if loop.index0 > ns.last_user_index and reasoning_content -%}
51
+ {{ '<think>' + reasoning_content.strip() + '</think>'}}
52
+ {%- else -%}
53
+ {{ '<think></think>' }}
54
+ {%- endif -%}
55
+ {%- if content.strip() -%}
56
+ {{ '\n' + content.strip() }}
57
+ {%- endif -%}
58
+ {% if m.tool_calls %}
59
+ {% for tc in m.tool_calls %}
60
+ {%- if tc.function %}
61
+ {%- set tc = tc.function %}
62
+ {%- endif %}
63
+ {{ '\n<tool_call>' + tc.name }}
64
+ {% set _args = tc.arguments %}
65
+ {% for k, v in _args.items() %}
66
+ <arg_key>{{ k }}</arg_key>
67
+ <arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>
68
+ {% endfor %}
69
+ </tool_call>{% endfor %}
70
+ {% endif %}
71
+ {{- '<|end_of_turn|>\n' }}
72
+ {%- elif m.role == 'tool' -%}
73
+ {%- if m.content is string -%}
74
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
75
+ {{- '<|start_of_turn|><|observation|>' }}
76
+ {%- endif %}
77
+ {{- '\n<tool_response>\n' }}
78
+ {{- m.content }}
79
+ {{- '\n</tool_response>' }}
80
+ {%- else -%}
81
+ <|start_of_turn|><|observation|>{% for tr in m.content %}
82
+
83
+ <tool_response>
84
+ {{ tr.output if tr.output is defined else tr }}
85
+ </tool_response>{% endfor -%}
86
+ {% endif -%}
87
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
88
+ {{- '<|end_of_turn|>\n' }}{%- endif -%}
89
+ {%- elif m.role == 'system' -%}
90
+ <|start_of_turn|><|system|>
91
+ {{ visible_text(m.content) }}
92
+ {{- '<|end_of_turn|>\n' }}
93
+ {%- endif -%}
94
+ {%- endfor -%}
95
+ {%- if add_generation_prompt -%}
96
+ {{- '<|start_of_turn|><|assistant|>\n' }}
97
+ {%- endif -%}
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "boi_token": "<|start_of_image|>",
3
+ "bos_token": {
4
+ "content": "[@BOS@]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ "eoi_token": "<|end_of_image|>",
11
+ "eos_token": {
12
+ "content": "<|end_of_turn|>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "image_token": "<|image_soft_token|>",
19
+ "pad_token": {
20
+ "content": "<pad>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<unk>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a574ceaaff7c7a8f091179c53fd17ae33567089c099d4ff37d4cb3bc1a87e80e
3
+ size 33627251
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff