tokenizer_config.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. {
  2. "add_bos_token": false,
  3. "add_eos_token": false,
  4. "add_prefix_space": false,
  5. "added_tokens_decoder": {
  6. "0": {
  7. "content": "<|endoftext|>",
  8. "lstrip": false,
  9. "normalized": false,
  10. "rstrip": false,
  11. "single_word": false,
  12. "special": true
  13. },
  14. "1": {
  15. "content": "<|im_start|>",
  16. "lstrip": false,
  17. "normalized": false,
  18. "rstrip": false,
  19. "single_word": false,
  20. "special": true
  21. },
  22. "2": {
  23. "content": "<|im_end|>",
  24. "lstrip": false,
  25. "normalized": false,
  26. "rstrip": false,
  27. "single_word": false,
  28. "special": true
  29. },
  30. "3": {
  31. "content": "<|object_ref_start|>",
  32. "lstrip": false,
  33. "normalized": false,
  34. "rstrip": false,
  35. "single_word": false,
  36. "special": true
  37. },
  38. "4": {
  39. "content": "<|object_ref_end|>",
  40. "lstrip": false,
  41. "normalized": false,
  42. "rstrip": false,
  43. "single_word": false,
  44. "special": true
  45. },
  46. "5": {
  47. "content": "<|box_start|>",
  48. "lstrip": false,
  49. "normalized": false,
  50. "rstrip": false,
  51. "single_word": false,
  52. "special": true
  53. },
  54. "6": {
  55. "content": "<|box_end|>",
  56. "lstrip": false,
  57. "normalized": false,
  58. "rstrip": false,
  59. "single_word": false,
  60. "special": true
  61. },
  62. "7": {
  63. "content": "<|quad_start|>",
  64. "lstrip": false,
  65. "normalized": false,
  66. "rstrip": false,
  67. "single_word": false,
  68. "special": true
  69. },
  70. "8": {
  71. "content": "<|quad_end|>",
  72. "lstrip": false,
  73. "normalized": false,
  74. "rstrip": false,
  75. "single_word": false,
  76. "special": true
  77. },
  78. "9": {
  79. "content": "<|vision_start|>",
  80. "lstrip": false,
  81. "normalized": false,
  82. "rstrip": false,
  83. "single_word": false,
  84. "special": true
  85. },
  86. "10": {
  87. "content": "<|vision_end|>",
  88. "lstrip": false,
  89. "normalized": false,
  90. "rstrip": false,
  91. "single_word": false,
  92. "special": true
  93. },
  94. "11": {
  95. "content": "<|vision_pad|>",
  96. "lstrip": false,
  97. "normalized": false,
  98. "rstrip": false,
  99. "single_word": false,
  100. "special": true
  101. },
  102. "12": {
  103. "content": "<|image_pad|>",
  104. "lstrip": false,
  105. "normalized": false,
  106. "rstrip": false,
  107. "single_word": false,
  108. "special": true
  109. },
  110. "13": {
  111. "content": "<|video_pad|>",
  112. "lstrip": false,
  113. "normalized": false,
  114. "rstrip": false,
  115. "single_word": false,
  116. "special": true
  117. },
  118. "14": {
  119. "content": "<|audio_start|>",
  120. "lstrip": false,
  121. "normalized": false,
  122. "rstrip": false,
  123. "single_word": false,
  124. "special": true
  125. },
  126. "15": {
  127. "content": "<|audio_end|>",
  128. "lstrip": false,
  129. "normalized": false,
  130. "rstrip": false,
  131. "single_word": false,
  132. "special": true
  133. },
  134. "16": {
  135. "content": "<|audio_pad|>",
  136. "lstrip": false,
  137. "normalized": false,
  138. "rstrip": false,
  139. "single_word": false,
  140. "special": true
  141. },
  142. "17": {
  143. "content": "<tts_pad>",
  144. "lstrip": false,
  145. "normalized": false,
  146. "rstrip": false,
  147. "single_word": false,
  148. "special": true
  149. },
  150. "18": {
  151. "content": "<tts_text_bos>",
  152. "lstrip": false,
  153. "normalized": false,
  154. "rstrip": false,
  155. "single_word": false,
  156. "special": true
  157. },
  158. "19": {
  159. "content": "<tts_text_eod>",
  160. "lstrip": false,
  161. "normalized": false,
  162. "rstrip": false,
  163. "single_word": false,
  164. "special": true
  165. },
  166. "20": {
  167. "content": "<tts_text_bos_single>",
  168. "lstrip": false,
  169. "normalized": false,
  170. "rstrip": false,
  171. "single_word": false,
  172. "special": true
  173. },
  174. "21": {
  175. "content": "<tool_call>",
  176. "lstrip": false,
  177. "normalized": false,
  178. "rstrip": false,
  179. "single_word": false,
  180. "special": false
  181. },
  182. "22": {
  183. "content": "</tool_call>",
  184. "lstrip": false,
  185. "normalized": false,
  186. "rstrip": false,
  187. "single_word": false,
  188. "special": false
  189. },
  190. "23": {
  191. "content": "<tool_response>",
  192. "lstrip": false,
  193. "normalized": false,
  194. "rstrip": false,
  195. "single_word": false,
  196. "special": false
  197. },
  198. "24": {
  199. "content": "</tool_response>",
  200. "lstrip": false,
  201. "normalized": false,
  202. "rstrip": false,
  203. "single_word": false,
  204. "special": false
  205. },
  206. "25": {
  207. "content": "<think>",
  208. "lstrip": false,
  209. "normalized": false,
  210. "rstrip": false,
  211. "single_word": false,
  212. "special": false
  213. },
  214. "26": {
  215. "content": "</think>",
  216. "lstrip": false,
  217. "normalized": false,
  218. "rstrip": false,
  219. "single_word": false,
  220. "special": false
  221. },
  222. "27": {
  223. "content": "<|buffer1|>",
  224. "lstrip": false,
  225. "normalized": false,
  226. "rstrip": false,
  227. "single_word": false,
  228. "special": false
  229. },
  230. "28": {
  231. "content": "<|buffer2|>",
  232. "lstrip": false,
  233. "normalized": false,
  234. "rstrip": false,
  235. "single_word": false,
  236. "special": false
  237. },
  238. "29": {
  239. "content": "<|buffer3|>",
  240. "lstrip": false,
  241. "normalized": false,
  242. "rstrip": false,
  243. "single_word": false,
  244. "special": false
  245. },
  246. "30": {
  247. "content": "<|buffer4|>",
  248. "lstrip": false,
  249. "normalized": false,
  250. "rstrip": false,
  251. "single_word": false,
  252. "special": false
  253. },
  254. "31": {
  255. "content": "<|buffer5|>",
  256. "lstrip": false,
  257. "normalized": false,
  258. "rstrip": false,
  259. "single_word": false,
  260. "special": false
  261. },
  262. "32": {
  263. "content": "<|buffer6|>",
  264. "lstrip": false,
  265. "normalized": false,
  266. "rstrip": false,
  267. "single_word": false,
  268. "special": false
  269. },
  270. "33": {
  271. "content": "<|buffer7|>",
  272. "lstrip": false,
  273. "normalized": false,
  274. "rstrip": false,
  275. "single_word": false,
  276. "special": false
  277. },
  278. "34": {
  279. "content": "<|buffer8|>",
  280. "lstrip": false,
  281. "normalized": false,
  282. "rstrip": false,
  283. "single_word": false,
  284. "special": false
  285. },
  286. "35": {
  287. "content": "<|buffer9|>",
  288. "lstrip": false,
  289. "normalized": false,
  290. "rstrip": false,
  291. "single_word": false,
  292. "special": false
  293. }
  294. },
  295. "additional_special_tokens": [
  296. "<|im_start|>",
  297. "<|im_end|>",
  298. "<|object_ref_start|>",
  299. "<|object_ref_end|>",
  300. "<|box_start|>",
  301. "<|box_end|>",
  302. "<|quad_start|>",
  303. "<|quad_end|>",
  304. "<|vision_start|>",
  305. "<|vision_end|>",
  306. "<|vision_pad|>",
  307. "<|image_pad|>",
  308. "<|video_pad|>",
  309. "<|audio_start|>",
  310. "<|audio_end|>",
  311. "<|audio_pad|>",
  312. "<tts_pad>",
  313. "<tts_text_bos>",
  314. "<tts_text_eod>",
  315. "<tts_text_bos_single>"
  316. ],
  317. "bos_token": "<|im_start|>",
  318. "clean_up_tokenization_spaces": false,
  319. "eos_token": "<|im_end|>",
  320. "legacy": true,
  321. "model_max_length": 131072,
  322. "pad_token": "<|endoftext|>",
  323. "sp_model_kwargs": {},
  324. "spaces_between_special_tokens": false,
  325. "unk_token": "<|endoftext|>",
  326. "image_token": "<|image_pad|>",
  327. "audio_token": "<|audio_pad|>",
  328. "video_token": "<|video_pad|>",
  329. "vision_bos_token": "<|vision_start|>",
  330. "vision_eos_token": "<|vision_end|>",
  331. "audio_bos_token": "<|audio_start|>",
  332. "audio_eos_token": "<|audio_end|>",
  333. "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# 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>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\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\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if true %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if open_thinking is defined and open_thinking is true %}\n {{- '<think>\\n' }}\n {%- else %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}",
  334. "tokenizer_class": "PreTrainedTokenizerFast"
  335. }