pavanperi commited on
Commit
bd360a8
·
verified ·
1 Parent(s): 93f4048

Move the tokenizer files in the root directory

Browse files
.gitattributes CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* 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/tokenizer.json 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/tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <|start_of_turn|><|system|>
11
+ You should reply in the same language as the user's request by default. If a later system or user instruction explicitly asks for a different language, follow that instruction instead.
12
+ {{- '<|end_of_turn|>\n' }}
13
+ {%- macro visible_text(content) -%}
14
+ {%- if content is string -%}
15
+ {{- content }}
16
+ {%- elif content is iterable and content is not mapping -%}
17
+ {%- for item in content -%}
18
+ {%- if item is mapping and item.type == 'text' -%}
19
+ {{- item.text }}
20
+ {%- elif item is string -%}
21
+ {{- item }}
22
+ {%- endif -%}
23
+ {%- endfor -%}
24
+ {%- elif content is none -%}
25
+ {{- '' }}
26
+ {%- else -%}
27
+ {{- content }}
28
+ {%- endif -%}
29
+ {%- endmacro -%}
30
+ {%- set ns = namespace(last_user_index=-1) %}
31
+ {%- for m in messages %}
32
+ {%- if m.role == 'user' %}
33
+ {% set ns.last_user_index = loop.index0 -%}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {% for m in messages %}
37
+ {%- if m.role == 'user' -%}<|start_of_turn|><|user|>
38
+ {{ visible_text(m.content) }}
39
+ {{- '<|nothink|>' if (enable_thinking is defined and not enable_thinking and not visible_text(m.content).endswith("<|nothink|>")) else '' -}}
40
+ {{- '<|end_of_turn|>\n' }}
41
+ {%- elif m.role == 'assistant' -%}
42
+ {{- '<|start_of_turn|><|assistant|>\n' }}
43
+ {%- set reasoning_content = '' %}
44
+ {%- set content = visible_text(m.content) %}
45
+ {%- if m.reasoning_content is string %}
46
+ {%- set reasoning_content = m.reasoning_content %}
47
+ {%- else %}
48
+ {%- if '</think>' in content %}
49
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
50
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
51
+ {%- endif %}
52
+ {%- endif %}
53
+ {%- if loop.index0 > ns.last_user_index and reasoning_content -%}
54
+ {{ '<think>' + reasoning_content.strip() + '</think>'}}
55
+ {%- else -%}
56
+ {{ '<think></think>' }}
57
+ {%- endif -%}
58
+ {%- if content.strip() -%}
59
+ {{ '\n' + content.strip() }}
60
+ {%- endif -%}
61
+ {% if m.tool_calls %}
62
+ {% for tc in m.tool_calls %}
63
+ {%- if tc.function %}
64
+ {%- set tc = tc.function %}
65
+ {%- endif %}
66
+ {{ '\n<tool_call>' + tc.name }}
67
+ {% set _args = tc.arguments %}
68
+ {% for k, v in _args.items() %}
69
+ <arg_key>{{ k }}</arg_key>
70
+ <arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>
71
+ {% endfor %}
72
+ </tool_call>{% endfor %}
73
+ {% endif %}
74
+ {{- '<|end_of_turn|>\n' }}
75
+ {%- elif m.role == 'tool' -%}
76
+ {%- if m.content is string -%}
77
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
78
+ {{- '<|start_of_turn|><|observation|>' }}
79
+ {%- endif %}
80
+ {{- '\n<tool_response>\n' }}
81
+ {{- m.content }}
82
+ {{- '\n</tool_response>' }}
83
+ {%- else -%}
84
+ <|start_of_turn|><|observation|>{% for tr in m.content %}
85
+
86
+ <tool_response>
87
+ {{ tr.output if tr.output is defined else tr }}
88
+ </tool_response>{% endfor -%}
89
+ {% endif -%}
90
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
91
+ {{- '<|end_of_turn|>\n' }}{%- endif -%}
92
+ {%- elif m.role == 'system' -%}
93
+ <|start_of_turn|><|system|>
94
+ {{ visible_text(m.content) }}
95
+ {{- '<|end_of_turn|>\n' }}
96
+ {%- endif -%}
97
+ {%- endfor -%}
98
+ {%- if add_generation_prompt -%}
99
+ {{- '<|start_of_turn|><|assistant|>\n' }}
100
+ {%- 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:c9e8c5a6ec2fd4c0c411af1125e1abcbd9f35fb9fbcd70f5352ac1b4873a0627
3
+ size 33627516
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff