File size: 6,754 Bytes
db18629
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
{
  "add_prefix_space": false,
  "added_tokens_decoder": {
    "0": {
      "content": "<|endoftext|>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "1": {
      "content": "<|im_start|>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "2": {
      "content": "<|im_end|>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "3": {
      "content": "<repo_name>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "4": {
      "content": "<reponame>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "5": {
      "content": "<file_sep>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "6": {
      "content": "<filename>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "7": {
      "content": "<gh_stars>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "8": {
      "content": "<issue_start>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "9": {
      "content": "<issue_comment>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "10": {
      "content": "<issue_closed>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "11": {
      "content": "<jupyter_start>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "12": {
      "content": "<jupyter_text>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "13": {
      "content": "<jupyter_code>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "14": {
      "content": "<jupyter_output>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "15": {
      "content": "<jupyter_script>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "16": {
      "content": "<empty_output>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "49152": {
      "content": "<fake_token_around_image>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "49153": {
      "content": "<image>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    },
    "49154": {
      "content": "<end_of_utterance>",
      "lstrip": false,
      "normalized": false,
      "rstrip": false,
      "single_word": false,
      "special": true
    }
  },
  "additional_special_tokens": [
    "<fake_token_around_image>",
    "<image>",
    "<end_of_utterance>"
  ],
  "bos_token": "<|im_start|>",
  "chat_template": "{%- set config = namespace(has_system_message=false, has_tools=false) -%}{%- set system_messages = messages | selectattr('role', 'equalto', 'system') | list -%}{%- set config.has_system_message = system_messages | length > 0 -%}{%- set config.has_tools = tools is not none and tools | length > 0 -%}{%- if not config.has_system_message -%}{%- set messages = [{ \"content\": \"You are an AI agent acting as a human assistant.\", \"role\": \"system\" }] + messages -%}{%- endif -%}{%- for message in messages -%}{% if loop.first %}{{ bos_token }}{% endif %}{{ message.role | capitalize }}:{{ ' ' }}{%- if message.role == 'system' -%}{{ message.content }}{%- if config.has_tools -%}{{ '\n\n' }}You are aware of the following tools in your environment:\n{\n  \"tools\": [\n  {% for tool in tools %}\n    {\n      \"function\": {\n        \"description\": \"{{ tool.function.description }}\",\n        \"name\": \"{{ tool.function.name }}\",\n        \"parameters\": {{ tool.function.parameters | tojson }}\n      },\n      \"type\": \"{{ tool.type }}\"\n    }{% if not loop.last %},{% endif %}\n\n  {% endfor %}\n  ]\n}\n\nIf you would like to suggest one or more tool calls, please respond in the following format:\n{\n  \"finish_reason\": \"tool_calls\",\n  \"tool_calls\": [\n    {\n      \"arguments\": \"{\\\"parameter_name\\\": \\\"parameter_value\\\"}\",\n      \"id\": \"call_id\",\n      \"name\": \"tool_name\"\n    }\n  ]\n}\n{%- endif -%}<end_of_utterance>{{ '\n' }}{%- endif -%}{%- if message.role == 'user' -%}{% if message['content'] is string %}{{message['content']}}{% else %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] in ['image', 'image_url'] %}{{ '<image>' }}{% endif %}{% endfor %}{% endif %}<end_of_utterance>{{ '\n' }}{%- endif -%}{%- if message.role == 'assistant' -%}{% generation %}{%- if message.tool_calls | default(false) -%}\n{\n  \"finish_reason\": \"tool_calls\",\n  \"tool_calls\": [\n  {% for tool_call in message.tool_calls %}\n    {\n      \"arguments\": {{ tool_call.function.arguments | tojson }},\n      \"id\": \"{{ tool_call.id }}\",\n      \"name\": \"{{ tool_call.function.name }}\"\n    }{% if not loop.last %},{% endif %}\n\n  {% endfor %}\n  ]\n}\n{%- else -%}{{ message.content }}{%- endif -%}{% endgeneration %}<end_of_utterance>{{ '\n' }}{%- endif -%}{%- if message.role == 'tool' -%}\n{\n  \"content\": {{ message.content | tojson }},\n  \"name\": \"{{ message.name }}\",\n  \"tool_call_id\": \"{{ message.tool_call_id }}\"\n}\n<end_of_utterance>{{ '\n' }}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%}Assistant:{{ ' ' }}{%- endif -%}",
  "clean_up_tokenization_spaces": false,
  "eos_token": "<end_of_utterance>",
  "legacy": false,
  "model_max_length": 16384,
  "pad_token": "<|im_end|>",
  "padding_side": "left",
  "processor_class": "Idefics3Processor",
  "tokenizer_class": "GPT2Tokenizer",
  "truncation_side": "left",
  "unk_token": "<|endoftext|>",
  "vocab_size": 49152
}