Upload Qwen3_5ForConditionalGeneration

#1
by albertvillanova HF Staff - opened
chat_template.jinja CHANGED
@@ -113,10 +113,12 @@
113
  {%- set reasoning_content = message.reasoning_content %}
114
  {%- endif %}
115
  {%- set reasoning_content = reasoning_content|trim %}
 
 
116
  {%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
117
- {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
118
  {%- else %}
119
- {{- '<|im_start|>' + message.role + '\n' + content }}
120
  {%- endif %}
121
  {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
122
  {%- for tool_call in message.tool_calls %}
@@ -143,7 +145,9 @@
143
  {{- '</function>\n</tool_call>' }}
144
  {%- endfor %}
145
  {%- endif %}
146
- {{- '<|im_end|>\n' }}
 
 
147
  {%- elif message.role == "tool" %}
148
  {%- if loop.previtem and loop.previtem.role != "tool" %}
149
  {{- '<|im_start|>user' }}
 
113
  {%- set reasoning_content = message.reasoning_content %}
114
  {%- endif %}
115
  {%- set reasoning_content = reasoning_content|trim %}
116
+ {{- '<|im_start|>' + message.role + '\n' }}
117
+ {%- generation %}
118
  {%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
119
+ {{- '<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
120
  {%- else %}
121
+ {{- content }}
122
  {%- endif %}
123
  {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
124
  {%- for tool_call in message.tool_calls %}
 
145
  {{- '</function>\n</tool_call>' }}
146
  {%- endfor %}
147
  {%- endif %}
148
+ {{- '<|im_end|>' }}
149
+ {%- endgeneration %}
150
+ {{- '\n' }}
151
  {%- elif message.role == "tool" %}
152
  {%- if loop.previtem and loop.previtem.role != "tool" %}
153
  {{- '<|im_start|>user' }}
config.json CHANGED
@@ -67,7 +67,7 @@
67
  "initializer_range": 0.02,
68
  "intermediate_size": 32,
69
  "model_type": "qwen3_5",
70
- "num_heads": 4,
71
  "num_position_embeddings": 2304,
72
  "out_hidden_size": 16,
73
  "patch_size": 16,
 
67
  "initializer_range": 0.02,
68
  "intermediate_size": 32,
69
  "model_type": "qwen3_5",
70
+ "num_heads": 2,
71
  "num_position_embeddings": 2304,
72
  "out_hidden_size": 16,
73
  "patch_size": 16,
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3b64dfe1a43968f0efb8e7d83a41844ba587ef69e73b31c47b393a64c428e404
3
  size 20322624
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33424b34c80e69675a9c6e8fb7fbe0767eca41a2a76fd167acff74229743835b
3
  size 20322624
tokenizer_config.json CHANGED
@@ -23,6 +23,44 @@
23
  "pad_token": "<|endoftext|>",
24
  "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+",
25
  "processor_class": "Qwen3VLProcessor",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  "split_special_tokens": false,
27
  "tokenizer_class": "TokenizersBackend",
28
  "unk_token": null,
 
23
  "pad_token": "<|endoftext|>",
24
  "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+",
25
  "processor_class": "Qwen3VLProcessor",
26
+ "response_template": {
27
+ "defaults": {
28
+ "role": "assistant"
29
+ },
30
+ "fields": {
31
+ "content": {
32
+ "close": [
33
+ "<|im_end|>",
34
+ "<|endoftext|>"
35
+ ],
36
+ "content": "text",
37
+ "join": "",
38
+ "repeats": true
39
+ },
40
+ "reasoning_content": {
41
+ "close_pattern": "</think>|(?=<tool_call>)",
42
+ "content": "text",
43
+ "open": "<think>"
44
+ },
45
+ "tool_calls": {
46
+ "close_pattern": "</tool_call>|(?=<tool_call>)",
47
+ "content": "xml-inline",
48
+ "content_args": {
49
+ "tag_pattern": "<parameter=(?P<key>[^>\\n]+)>\\n?(?P<value>.*?)\\n?(?:</parameter>|(?=<parameter=)|(?=</function>))"
50
+ },
51
+ "open_pattern": "<tool_call>\\s*<function=(?P<name>[^>\\n]+)>",
52
+ "repeats": true,
53
+ "transform": {
54
+ "function": {
55
+ "arguments": "{content}",
56
+ "name": "{name}"
57
+ },
58
+ "type": "function"
59
+ }
60
+ }
61
+ },
62
+ "start_anchor": "<|im_start|>assistant\n"
63
+ },
64
  "split_special_tokens": false,
65
  "tokenizer_class": "TokenizersBackend",
66
  "unk_token": null,