arjunbroepic commited on
Commit
d0a77ea
·
verified ·
1 Parent(s): 631ca09

Upload model trained with Unsloth

Browse files

Upload model trained with Unsloth 2x faster

Files changed (4) hide show
  1. .gitattributes +1 -0
  2. chat_template.jinja +131 -0
  3. tokenizer.json +3 -0
  4. tokenizer_config.json +33 -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,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
2
+ {%- if content is string %}
3
+ {{- content }}
4
+ {%- elif content is iterable and content is not mapping %}
5
+ {%- for item in content %}
6
+ {%- if 'text' in item %}
7
+ {{- item.text }}
8
+ {%- else %}
9
+ {{- raise_exception('Unexpected item type in content.') }}
10
+ {%- endif %}
11
+ {%- endfor %}
12
+ {%- elif content is none or content is undefined %}
13
+ {{- '' }}
14
+ {%- else %}
15
+ {{- raise_exception('Unexpected content type.') }}
16
+ {%- endif %}
17
+ {%- endmacro %}
18
+ {%- if not messages %}
19
+ {{- raise_exception('No messages provided.') }}
20
+ {%- endif %}
21
+ {%- if tools and tools is iterable and tools is not mapping %}
22
+ {{- '<|im_start|>system\n' }}
23
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
24
+ {%- for tool in tools %}
25
+ {{- "\n" }}
26
+ {{- tool | tojson }}
27
+ {%- endfor %}
28
+ {{- "\n</tools>" }}
29
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
30
+ {%- if messages[0].role == 'system' %}
31
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
32
+ {%- if content %}
33
+ {{- '\n\n' + content }}
34
+ {%- endif %}
35
+ {%- endif %}
36
+ {{- '<|im_end|>\n' }}
37
+ {%- else %}
38
+ {%- if messages[0].role == 'system' %}
39
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
40
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
41
+ {%- endif %}
42
+ {%- endif %}
43
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
44
+ {%- for message in messages[::-1] %}
45
+ {%- set index = (messages|length - 1) - loop.index0 %}
46
+ {%- if ns.multi_step_tool and message.role == "user" %}
47
+ {%- set content = render_content(message.content, false)|trim %}
48
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
49
+ {%- set ns.multi_step_tool = false %}
50
+ {%- set ns.last_query_index = index %}
51
+ {%- endif %}
52
+ {%- endif %}
53
+ {%- endfor %}
54
+ {%- if ns.multi_step_tool %}
55
+ {{- raise_exception('No user query found in messages.') }}
56
+ {%- endif %}
57
+ {%- for message in messages %}
58
+ {%- set content = render_content(message.content, true)|trim %}
59
+ {%- if message.role == "system" %}
60
+ {%- if not loop.first %}
61
+ {{- raise_exception('System message must be at the beginning.') }}
62
+ {%- endif %}
63
+ {%- elif message.role == "user" %}
64
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
65
+ {%- elif message.role == "assistant" %}
66
+ {%- set reasoning_content = '' %}
67
+ {%- if message.reasoning_content is string %}
68
+ {%- set reasoning_content = message.reasoning_content %}
69
+ {%- else %}
70
+ {%- if '</think>' in content %}
71
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
72
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
73
+ {%- endif %}
74
+ {%- endif %}
75
+ {%- set reasoning_content = reasoning_content|trim %}
76
+ {%- if loop.index0 > ns.last_query_index %}
77
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
78
+ {%- else %}
79
+ {{- '<|im_start|>' + message.role + '\n' + content }}
80
+ {%- endif %}
81
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
82
+ {%- for tool_call in message.tool_calls %}
83
+ {%- if tool_call.function is defined %}
84
+ {%- set tool_call = tool_call.function %}
85
+ {%- endif %}
86
+ {%- if loop.first %}
87
+ {%- if content|trim %}
88
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
89
+ {%- else %}
90
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
91
+ {%- endif %}
92
+ {%- else %}
93
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
94
+ {%- endif %}
95
+ {%- if tool_call.arguments is mapping %}
96
+ {%- for args_name in tool_call.arguments %}
97
+ {%- set args_value = tool_call.arguments[args_name] %}
98
+ {{- '<parameter=' + args_name + '>\n' }}
99
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
100
+ {{- args_value }}
101
+ {{- '\n</parameter>\n' }}
102
+ {%- endfor %}
103
+ {%- endif %}
104
+ {{- '</function>\n</tool_call>' }}
105
+ {%- endfor %}
106
+ {%- endif %}
107
+ {{- '<|im_end|>\n' }}
108
+ {%- elif message.role == "tool" %}
109
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
110
+ {{- '<|im_start|>user' }}
111
+ {%- endif %}
112
+ {{- '\n<tool_response>\n' }}
113
+ {{- content }}
114
+ {{- '\n</tool_response>' }}
115
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
116
+ {{- '<|im_end|>\n' }}
117
+ {%- elif loop.last %}
118
+ {{- '<|im_end|>\n' }}
119
+ {%- endif %}
120
+ {%- else %}
121
+ {{- raise_exception('Unexpected message role.') }}
122
+ {%- endif %}
123
+ {%- endfor %}
124
+ {%- if add_generation_prompt %}
125
+ {{- '<|im_start|>assistant\n' }}
126
+ {%- if enable_thinking is defined and enable_thinking is true %}
127
+ {{- '<think>\n' }}
128
+ {%- else %}
129
+ {{- '<think>\n\n</think>\n\n' }}
130
+ {%- endif %}
131
+ {%- endif %}
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61fe6e68b24ec2f38f237945aef10539c224fd626670c34273b66114ce707575
3
+ size 19989533
tokenizer_config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": false,
13
+ "model_max_length": 262144,
14
+ "model_specific_special_tokens": {
15
+ "audio_bos_token": "<|audio_start|>",
16
+ "audio_eos_token": "<|audio_end|>",
17
+ "audio_token": "<|audio_pad|>",
18
+ "image_token": "<|image_pad|>",
19
+ "video_token": "<|video_pad|>",
20
+ "vision_bos_token": "<|vision_start|>",
21
+ "vision_eos_token": "<|vision_end|>"
22
+ },
23
+ "pad_token": "<|PAD_TOKEN|>",
24
+ "padding_side": "left",
25
+ "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
26
+ "processor_class": "Qwen3VLProcessor",
27
+ "split_special_tokens": false,
28
+ "tokenizer_class": "TokenizersBackend",
29
+ "unk_token": null,
30
+ "video_token": "<|video_pad|>",
31
+ "vision_bos_token": "<|vision_start|>",
32
+ "vision_eos_token": "<|vision_end|>"
33
+ }