Bingsu commited on
Commit
7626447
·
verified ·
1 Parent(s): b647700

Update tokenizer.json and chat_template.jinja

Browse files
Files changed (2) hide show
  1. chat_template.jinja +72 -0
  2. tokenizer.json +0 -0
chat_template.jinja ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools is iterable and tools | length > 0 %}
2
+ {{- '<|im_start|><|system|>'}}
3
+ {{- '당신은 도구 호출 기능을 갖춘 유용한 도우미입니다. 사용자의 요청을 처리하기 위해서 필요한 도구가 주어진 목록에 있는 경우 도구 호출로 응답하세요.
4
+ 필요한 도구가 목록에 없는 경우에는 도구 호출 없이 사용자가 요구한 정보를 제공하세요.
5
+ 필요한 도구가 목록에 있지만 해당 도구를 호출하는데 필요한 argument 정보가 부족한 경우 해당 정보를 사용자에게 요청하세요.
6
+ 사용자의 요청을 처리하기 위해 여러번 도구를 호출할 수 있어야 합니다.
7
+ 도구 호출 이후 도구 실행 결과를 입력으로 받으면 해당 결과를 활용하여 답변을 생성하세요.
8
+
9
+ 다음은 접근할 수 있는 도구들의 목록 입니다:
10
+ <tools>
11
+ '}}
12
+ {%- for t in tools %}
13
+ {{- t | tojson }}
14
+ {{- '
15
+ ' }}
16
+ {%- endfor %}
17
+ {{- '</tools>' }}
18
+ {{- '
19
+
20
+ 도구를 호출하려면 아래의 JSON으로 응답하세요.
21
+ 도구 호출 형식: <tool_call>{"name": 도구 이름, "arguments": dictionary 형태의 도구 인자값}</tool_call>' }}
22
+ {{- '<|im_end|>' }}
23
+ {%- endif %}
24
+
25
+ {%- for message in messages %}
26
+ {%- if message.role == 'system' %}
27
+ {{- '<|im_start|><|system|>' + message.content + '<|im_end|>'}}
28
+ {%- elif message.role == 'user' %}
29
+ {{- '<|im_start|><|user|>' + message.content + '<|im_end|>'}}
30
+ {%- elif message.role == 'assistant' %}
31
+ {{- '<|im_start|><|assistant|>'}}
32
+ {%- set content = '' %}
33
+ {%- if message.content is defined %}
34
+ {%- set content = message.content %}
35
+ {%- endif %}
36
+
37
+ {%- if add_generation_prompt and not (message.reasoning_content is defined and message.reasoning_content is not none) %}
38
+ {%- if '</think>' in message.content %}
39
+ {%- set content = message.content.split('</think>'.strip())[-1].lstrip('\n') %}
40
+ {%- endif %}
41
+ {%- endif %}
42
+
43
+ {{- content}}
44
+ {%- if message.tool_calls is defined %}
45
+ {%- for tool_call in message.tool_calls %}
46
+ {%- if tool_call.function is defined %}
47
+ {%- set tool_call = tool_call.function %}
48
+ {%- endif %}
49
+ {{- '<tool_call>' }}
50
+ {{- '{' }}
51
+ {{- '"name": "' }}
52
+ {{- tool_call.name }}
53
+ {{- '"' }}
54
+ {%- if tool_call.arguments is defined %}
55
+ {{- ', ' }}
56
+ {{- '"arguments": ' }}
57
+ {{- tool_call.arguments|tojson }}
58
+ {%- endif %}
59
+ {{- '}' }}
60
+ {{- '</tool_call>' }}
61
+ {%- endfor %}
62
+ {%- endif %}
63
+ {{- '<|im_end|>'}}
64
+
65
+ {%- elif message.role == 'tool' %}
66
+ {{- '<|im_start|><|extra_id_13|><tool_output>' + message.content + '</tool_output><|im_end|>'}}
67
+ {%- endif %}
68
+ {%- endfor %}
69
+
70
+ {%- if add_generation_prompt %}
71
+ {{- '<|im_start|><|assistant|>' }}
72
+ {%- endif %}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff