kyubeen commited on
Commit
d4b4979
·
verified ·
1 Parent(s): ebfa554

Upload tokenizer

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. chat_template.jinja +65 -0
  3. tokenizer.json +3 -0
  4. tokenizer_config.json +14 -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,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if false %}
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
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- for message in messages %}
18
+ {%- if message.content is string %}
19
+ {%- set content = message.content %}
20
+ {%- else %}
21
+ {%- set content = '' %}
22
+ {%- endif %}
23
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
24
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
25
+ {%- elif message.role == "assistant" %}
26
+ {# --- 변경 시작: Header는 Generation 블록 바깥에 위치 --- #}
27
+ {{- '<|im_start|>' + message.role + '\n' -}}
28
+ {%- generation -%}
29
+ {{- content -}}
30
+ {%- if message.tool_calls %}
31
+ {%- for tool_call in message.tool_calls %}
32
+ {%- if (loop.first and content) or (not loop.first) %}
33
+ {{- '\n' }}
34
+ {%- endif %}
35
+ {%- if tool_call.function %}
36
+ {%- set tool_call = tool_call.function %}
37
+ {%- endif %}
38
+ {{- '<tool_call>\n{"name": "' }}
39
+ {{- tool_call.name }}
40
+ {{- '", "arguments": ' }}
41
+ {%- if tool_call.arguments is string %}
42
+ {{- tool_call.arguments }}
43
+ {%- else %}
44
+ {{- tool_call.arguments | tojson }}
45
+ {%- endif %}
46
+ {{- '}\n</tool_call>' }}
47
+ {%- endfor %}
48
+ {%- endif %}
49
+ {{- '<|im_end|>\n' -}}
50
+ {%- endgeneration -%}
51
+ {%- elif message.role == "tool" %}
52
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
53
+ {{- '<|im_start|>user' }}
54
+ {%- endif %}
55
+ {{- '\n<tool_response>\n' }}
56
+ {{- content }}
57
+ {{- '\n</tool_response>' }}
58
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
59
+ {{- '<|im_end|>\n' }}
60
+ {%- endif %}
61
+ {%- endif %}
62
+ {%- endfor %}
63
+ {%- if add_generation_prompt %}
64
+ {{- '<|im_start|>assistant\n' }}
65
+ {%- endif %}
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
3
+ size 11422650
tokenizer_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "is_local": true,
9
+ "model_max_length": 131072,
10
+ "pad_token": "<|endoftext|>",
11
+ "split_special_tokens": false,
12
+ "tokenizer_class": "Qwen2Tokenizer",
13
+ "unk_token": null
14
+ }