Upload 5 files
Browse files- chat_template.jinja +97 -0
- config.json +87 -0
- model.q4nx +2 -2
- tokenizer.json +2 -2
- tokenizer_config.json +37 -0
chat_template.jinja
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- macro render_value(value) -%}
|
| 2 |
+
{%- if value is string -%}
|
| 3 |
+
{{- value -}}
|
| 4 |
+
{%- else -%}
|
| 5 |
+
{{- value | tojson(ensure_ascii=False) -}}
|
| 6 |
+
{%- endif -%}
|
| 7 |
+
{%- endmacro -%}
|
| 8 |
+
|
| 9 |
+
{%- macro render_content(message_content) -%}
|
| 10 |
+
{%- if message_content is string -%}
|
| 11 |
+
{{- message_content -}}
|
| 12 |
+
{%- elif message_content is iterable -%}
|
| 13 |
+
{%- for part in message_content -%}
|
| 14 |
+
{%- if part is not mapping -%}
|
| 15 |
+
{{- part -}}
|
| 16 |
+
{%- elif part['type'] == 'image' or 'image' in part or 'image_url' in part -%}
|
| 17 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' -}}
|
| 18 |
+
{%- elif part['type'] == 'audio' or part['type'] == 'input_audio' or 'audio' in part or 'audio_url' in part or 'input_audio' in part -%}
|
| 19 |
+
{{- '<|mimo_audio_start|><|audio_pad|><|mimo_audio_end|>' -}}
|
| 20 |
+
{%- elif part['type'] == 'video' or 'video' in part or 'video_url' in part -%}
|
| 21 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' -}}
|
| 22 |
+
{%- elif 'text' in part -%}
|
| 23 |
+
{{- part['text'] -}}
|
| 24 |
+
{%- endif -%}
|
| 25 |
+
{%- endfor -%}
|
| 26 |
+
{%- endif -%}
|
| 27 |
+
{%- endmacro -%}
|
| 28 |
+
|
| 29 |
+
{%- macro render_tools(tools) -%}
|
| 30 |
+
{{- 'You are provided with the following tools:\n\n<tools>' -}}
|
| 31 |
+
{%- for tool in tools -%}
|
| 32 |
+
{{- '\n' ~ (tool | tojson(ensure_ascii=False)) -}}
|
| 33 |
+
{%- endfor -%}
|
| 34 |
+
{{- '\n</tools>' -}}
|
| 35 |
+
{%- endmacro -%}
|
| 36 |
+
|
| 37 |
+
{%- macro render_tool_calls(tool_calls) -%}
|
| 38 |
+
{%- for tool_call in tool_calls -%}
|
| 39 |
+
{%- if tool_call.function is defined -%}
|
| 40 |
+
{%- set tool_call = tool_call.function -%}
|
| 41 |
+
{%- elif tool_call.custom is defined -%}
|
| 42 |
+
{%- set tool_call = tool_call.custom -%}
|
| 43 |
+
{%- endif -%}
|
| 44 |
+
{{- '<tool_call><function=' ~ tool_call.name ~ '>' -}}
|
| 45 |
+
{%- if tool_call.input is defined and tool_call.input is string -%}
|
| 46 |
+
{{- tool_call.input -}}
|
| 47 |
+
{%- elif tool_call.arguments -%}
|
| 48 |
+
{%- if tool_call.arguments is string -%}
|
| 49 |
+
{{- tool_call.arguments -}}
|
| 50 |
+
{%- else -%}
|
| 51 |
+
{%- for args_name, args_value in tool_call.arguments | items -%}
|
| 52 |
+
{{- '<parameter=' ~ args_name ~ '>' ~ render_value(args_value) ~ '</parameter>' -}}
|
| 53 |
+
{%- endfor -%}
|
| 54 |
+
{%- endif -%}
|
| 55 |
+
{%- endif -%}
|
| 56 |
+
{{- '</function></tool_call>' -}}
|
| 57 |
+
{%- endfor -%}
|
| 58 |
+
{%- endmacro -%}
|
| 59 |
+
|
| 60 |
+
{%- macro render_assistant_message(message) -%}
|
| 61 |
+
{%- generation -%}
|
| 62 |
+
{%- set content = render_content(message.content) -%}
|
| 63 |
+
{%- set reasoning = message.reasoning_content if message.reasoning_content is string else '' -%}
|
| 64 |
+
{{- '<|im_start|>assistant\n<think>' ~ reasoning ~ '</think>' ~ content -}}
|
| 65 |
+
{%- if message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 -%}
|
| 66 |
+
{{- render_tool_calls(message.tool_calls) -}}
|
| 67 |
+
{%- endif -%}
|
| 68 |
+
{{- '<|im_end|>' -}}
|
| 69 |
+
{%- endgeneration -%}
|
| 70 |
+
{%- endmacro -%}
|
| 71 |
+
|
| 72 |
+
{%- if tools is defined and tools is iterable and tools | length > 0 -%}
|
| 73 |
+
{{- '<|im_start|>system\n' ~ render_tools(tools) ~ '<|im_end|>' -}}
|
| 74 |
+
{%- endif -%}
|
| 75 |
+
|
| 76 |
+
{%- for message in messages -%}
|
| 77 |
+
{%- if message.role == 'assistant' -%}
|
| 78 |
+
{{- render_assistant_message(message) -}}
|
| 79 |
+
{%- else -%}
|
| 80 |
+
{%- set body = render_content(message.content) -%}
|
| 81 |
+
{{- '<|im_start|>' ~ message.role ~ '\n' ~ body -}}
|
| 82 |
+
{%- if message.tools is defined and message.tools is iterable and message.tools | length > 0 -%}
|
| 83 |
+
{%- if body -%}
|
| 84 |
+
{{- '\n\n' -}}
|
| 85 |
+
{%- endif -%}
|
| 86 |
+
{{- render_tools(message.tools) -}}
|
| 87 |
+
{%- endif -%}
|
| 88 |
+
{{- '<|im_end|>' -}}
|
| 89 |
+
{%- endif -%}
|
| 90 |
+
{%- endfor -%}
|
| 91 |
+
|
| 92 |
+
{%- if add_generation_prompt -%}
|
| 93 |
+
{{- '<|im_start|>assistant\n' -}}
|
| 94 |
+
{%- if enable_thinking is false -%}
|
| 95 |
+
{{- '<think></think>' -}}
|
| 96 |
+
{%- endif -%}
|
| 97 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3_5ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"image_token_id": 248056,
|
| 6 |
+
"model_type": "qwen3_5_text",
|
| 7 |
+
"tie_word_embeddings": false,
|
| 8 |
+
"transformers_version": "5.12.1",
|
| 9 |
+
"video_token_id": 248057,
|
| 10 |
+
"vision_end_token_id": 248054,
|
| 11 |
+
"vision_start_token_id": 248053,
|
| 12 |
+
"attention_bias": false,
|
| 13 |
+
"attention_dropout": 0.0,
|
| 14 |
+
"attn_output_gate": true,
|
| 15 |
+
"bos_token_id": null,
|
| 16 |
+
"dtype": "bfloat16",
|
| 17 |
+
"eos_token_id": 248044,
|
| 18 |
+
"full_attention_interval": 4,
|
| 19 |
+
"head_dim": 256,
|
| 20 |
+
"hidden_act": "silu",
|
| 21 |
+
"hidden_size": 4096,
|
| 22 |
+
"initializer_range": 0.02,
|
| 23 |
+
"intermediate_size": 12288,
|
| 24 |
+
"layer_types": [
|
| 25 |
+
"linear_attention",
|
| 26 |
+
"linear_attention",
|
| 27 |
+
"linear_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"linear_attention",
|
| 30 |
+
"linear_attention",
|
| 31 |
+
"linear_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"linear_attention",
|
| 34 |
+
"linear_attention",
|
| 35 |
+
"linear_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"linear_attention",
|
| 38 |
+
"linear_attention",
|
| 39 |
+
"linear_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"linear_attention",
|
| 42 |
+
"linear_attention",
|
| 43 |
+
"linear_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"linear_attention",
|
| 46 |
+
"linear_attention",
|
| 47 |
+
"linear_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"linear_attention",
|
| 50 |
+
"linear_attention",
|
| 51 |
+
"linear_attention",
|
| 52 |
+
"full_attention",
|
| 53 |
+
"linear_attention",
|
| 54 |
+
"linear_attention",
|
| 55 |
+
"linear_attention",
|
| 56 |
+
"full_attention"
|
| 57 |
+
],
|
| 58 |
+
"linear_conv_kernel_dim": 4,
|
| 59 |
+
"linear_key_head_dim": 128,
|
| 60 |
+
"linear_num_key_heads": 16,
|
| 61 |
+
"linear_num_value_heads": 32,
|
| 62 |
+
"linear_value_head_dim": 128,
|
| 63 |
+
"mamba_ssm_dtype": "float32",
|
| 64 |
+
"max_position_embeddings": 262144,
|
| 65 |
+
"mlp_only_layers": [],
|
| 66 |
+
"mtp_num_hidden_layers": 1,
|
| 67 |
+
"mtp_use_dedicated_embeddings": false,
|
| 68 |
+
"num_attention_heads": 16,
|
| 69 |
+
"num_hidden_layers": 32,
|
| 70 |
+
"num_key_value_heads": 4,
|
| 71 |
+
"pad_token_id": null,
|
| 72 |
+
"partial_rotary_factor": 0.25,
|
| 73 |
+
"rms_norm_eps": 1e-06,
|
| 74 |
+
"rope_parameters": {
|
| 75 |
+
"mrope_interleaved": true,
|
| 76 |
+
"mrope_section": [
|
| 77 |
+
11,
|
| 78 |
+
11,
|
| 79 |
+
10
|
| 80 |
+
],
|
| 81 |
+
"partial_rotary_factor": 0.25,
|
| 82 |
+
"rope_theta": 10000000,
|
| 83 |
+
"rope_type": "default"
|
| 84 |
+
},
|
| 85 |
+
"use_cache": true,
|
| 86 |
+
"vocab_size": 248320
|
| 87 |
+
}
|
model.q4nx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2e7360e34e567ff8aa27789117c55a95633cab4a9ccdc8fb6ec7e471a2da6932
|
| 3 |
+
size 7453755600
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523
|
| 3 |
+
size 19989325
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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": true,
|
| 13 |
+
"local_files_only": false,
|
| 14 |
+
"model_max_length": 262144,
|
| 15 |
+
"model_specific_special_tokens": {
|
| 16 |
+
"audio_bos_token": "<|audio_start|>",
|
| 17 |
+
"audio_eos_token": "<|audio_end|>",
|
| 18 |
+
"audio_token": "<|audio_pad|>",
|
| 19 |
+
"image_token": "<|image_pad|>",
|
| 20 |
+
"video_token": "<|video_pad|>",
|
| 21 |
+
"vision_bos_token": "<|vision_start|>",
|
| 22 |
+
"vision_eos_token": "<|vision_end|>"
|
| 23 |
+
},
|
| 24 |
+
"pad_token": "<|endoftext|>",
|
| 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": "Qwen2Tokenizer",
|
| 29 |
+
"unk_token": null,
|
| 30 |
+
"video_token": "<|video_pad|>",
|
| 31 |
+
"vision_bos_token": "<|vision_start|>",
|
| 32 |
+
"vision_eos_token": "<|vision_end|>",
|
| 33 |
+
"eos_token_id": [
|
| 34 |
+
248046
|
| 35 |
+
],
|
| 36 |
+
"pad_token_id": 248044
|
| 37 |
+
}
|