Update tiny models for Step3p7Model
Browse files- chat_template.jinja +89 -0
- config.json +81 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +16 -0
chat_template.jinja
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% macro render_message_content(message) %}{% if message.content is none %}{{- '' }}{% elif message.content is string %}{{- message.content }}{% elif message.content is mapping %}{{- message.content['value'] if 'value' in message.content else message.content['text'] }}{% elif message.content is iterable %}{% set ns = namespace(needs_text_separator=false) %}{% for item in message.content %}{% if item.type == 'text' %}{% if ns.needs_text_separator %}{{- ' ' }}{% endif %}{{- item['value'] if 'value' in item else item['text'] }}{% set ns.needs_text_separator = true %}{% elif item.type == 'image' %}<im_patch>{% set ns.needs_text_separator = false %}{% endif %}{% endfor %}{% endif %}{% endmacro %}
|
| 2 |
+
{{bos_token}}{%- if tools %}
|
| 3 |
+
{{- '<|im_start|>system\n' }}
|
| 4 |
+
{%- if reasoning_effort is defined %}
|
| 5 |
+
{{- "Reasoning: " + reasoning_effort + '\n\n' }}
|
| 6 |
+
{%- endif %}
|
| 7 |
+
{%- if messages[0].role == 'system' %}
|
| 8 |
+
{{- render_message_content(messages[0]) + '\n\n' }}
|
| 9 |
+
{%- endif %}
|
| 10 |
+
{{- "# Tools\n\nYou have access to the following functions in JSONSchema format:\n\n<tools>" }}
|
| 11 |
+
{%- for tool in tools %}
|
| 12 |
+
{{- "\n" }}
|
| 13 |
+
{{- tool | tojson(ensure_ascii=False) }}
|
| 14 |
+
{%- endfor %}
|
| 15 |
+
{{- "\n</tools>\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=...>\n...\n</function> block must be nested within <tool_call>\n...\n</tool_call> XML tags\n- Required parameters MUST be specified\n</IMPORTANT><|im_end|>\n" }}
|
| 16 |
+
{%- else %}
|
| 17 |
+
{%- if messages[0].role == 'system' %}
|
| 18 |
+
{{- '<|im_start|>system\n' }}
|
| 19 |
+
{%- if reasoning_effort is defined %}
|
| 20 |
+
{{- "Reasoning: " + reasoning_effort + '\n\n' }}
|
| 21 |
+
{%- endif %}
|
| 22 |
+
{{- render_message_content(messages[0]) + '<|im_end|>\n' }}
|
| 23 |
+
{%- elif reasoning_effort is defined %}
|
| 24 |
+
{{- '<|im_start|>system\n' + "Reasoning: " + reasoning_effort + '\n\n' + '<|im_end|>\n' }}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- endif %}
|
| 27 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 28 |
+
{%- for message in messages[::-1] %}
|
| 29 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 30 |
+
{%- if ns.multi_step_tool and message.role == "user" and render_message_content(message) is string and not(render_message_content(message).startswith('<tool_response>') and render_message_content(message).endswith('</tool_response>')) %}
|
| 31 |
+
{%- set ns.multi_step_tool = false %}
|
| 32 |
+
{%- set ns.last_query_index = index %}
|
| 33 |
+
{%- endif %}
|
| 34 |
+
{%- endfor %}
|
| 35 |
+
{%- for message in messages %}
|
| 36 |
+
{%- set content = render_message_content(message) %}
|
| 37 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 38 |
+
{%- set role_name = 'observation' if (message.role == "system" and not loop.first and message.name == 'observation') else message.role %}
|
| 39 |
+
{{- '<|im_start|>' + role_name + '\n' + content + '<|im_end|>' + '\n' }}
|
| 40 |
+
{%- elif message.role == "assistant" %}
|
| 41 |
+
{%- if message.reasoning_content is string %}
|
| 42 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 43 |
+
{%- else %}
|
| 44 |
+
{%- if '</think>' in content %}
|
| 45 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 46 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 47 |
+
{%- else %}
|
| 48 |
+
{%- set reasoning_content = '' %}
|
| 49 |
+
{%- endif %}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 52 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n' + content }}
|
| 53 |
+
{%- else %}
|
| 54 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{%- if message.tool_calls %}
|
| 57 |
+
{%- for tool_call in message.tool_calls %}
|
| 58 |
+
{%- if tool_call.function is defined %}
|
| 59 |
+
{%- set tool_call = tool_call.function %}
|
| 60 |
+
{%- endif %}
|
| 61 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 62 |
+
{%- if tool_call.arguments is defined %}
|
| 63 |
+
{%- set arguments = tool_call.arguments | fromjson if tool_call.arguments is string else tool_call.arguments %}
|
| 64 |
+
{%- for args_name, args_value in arguments|items %}
|
| 65 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 66 |
+
{%- set args_value = args_value | tojson(ensure_ascii=False) | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
|
| 67 |
+
{{- args_value }}
|
| 68 |
+
{{- '\n</parameter>\n' }}
|
| 69 |
+
{%- endfor %}
|
| 70 |
+
{%- endif %}
|
| 71 |
+
{{- '</function>\n</tool_call>' }}
|
| 72 |
+
{%- endfor %}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{{- '<|im_end|>\n' }}
|
| 75 |
+
{%- elif message.role == "tool" %}
|
| 76 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 77 |
+
{{- '<|im_start|>tool_response\n' }}
|
| 78 |
+
{%- endif %}
|
| 79 |
+
{{- '<tool_response>' }}
|
| 80 |
+
{{- content }}
|
| 81 |
+
{{- '</tool_response>' }}
|
| 82 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 83 |
+
{{- '<|im_end|>\n' }}
|
| 84 |
+
{%- endif %}
|
| 85 |
+
{%- endif %}
|
| 86 |
+
{%- endfor %}
|
| 87 |
+
{%- if add_generation_prompt %}
|
| 88 |
+
{{- '<|im_start|>assistant\n<think>\n' }}
|
| 89 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Step3p7Model"
|
| 4 |
+
],
|
| 5 |
+
"dtype": "float32",
|
| 6 |
+
"image_token_id": 4,
|
| 7 |
+
"model_type": "step3p7",
|
| 8 |
+
"pad_token_id": 1,
|
| 9 |
+
"projector_bias": false,
|
| 10 |
+
"text_config": {
|
| 11 |
+
"attention_bias": false,
|
| 12 |
+
"attention_dropout": 0.0,
|
| 13 |
+
"bos_token_id": 0,
|
| 14 |
+
"eos_token_id": 128007,
|
| 15 |
+
"head_dim": 8,
|
| 16 |
+
"hidden_act": "silu",
|
| 17 |
+
"hidden_size": 16,
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"intermediate_size": 37,
|
| 20 |
+
"layer_types": [
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention"
|
| 23 |
+
],
|
| 24 |
+
"max_position_embeddings": 200,
|
| 25 |
+
"mlp_bias": false,
|
| 26 |
+
"mlp_layer_types": [
|
| 27 |
+
"dense",
|
| 28 |
+
"sparse"
|
| 29 |
+
],
|
| 30 |
+
"model_type": "step3p5",
|
| 31 |
+
"moe_intermediate_size": 8,
|
| 32 |
+
"moe_router_scaling_factor": 1.0,
|
| 33 |
+
"mtp_layer_types": null,
|
| 34 |
+
"mtp_mlp_layer_types": null,
|
| 35 |
+
"n_routed_experts": 4,
|
| 36 |
+
"num_attention_heads": 2,
|
| 37 |
+
"num_experts_per_tok": 2,
|
| 38 |
+
"num_hidden_layers": 2,
|
| 39 |
+
"num_key_value_heads": 1,
|
| 40 |
+
"num_nextn_predict_layers": 0,
|
| 41 |
+
"num_sliding_attention_heads": 2,
|
| 42 |
+
"pad_token_id": 1,
|
| 43 |
+
"per_layer_config": {},
|
| 44 |
+
"query_pre_attn_scalar": 8,
|
| 45 |
+
"rms_norm_eps": 1e-05,
|
| 46 |
+
"rope_parameters": {
|
| 47 |
+
"full_attention": {
|
| 48 |
+
"rope_theta": 10000.0,
|
| 49 |
+
"rope_type": "default"
|
| 50 |
+
}
|
| 51 |
+
},
|
| 52 |
+
"share_expert_dim": 8,
|
| 53 |
+
"sliding_window": 64,
|
| 54 |
+
"swiglu_limits": null,
|
| 55 |
+
"swiglu_limits_shared": null,
|
| 56 |
+
"tie_word_embeddings": false,
|
| 57 |
+
"use_cache": true,
|
| 58 |
+
"vocab_size": 128815
|
| 59 |
+
},
|
| 60 |
+
"transformers_version": "5.19.0.dev0",
|
| 61 |
+
"vision_config": {
|
| 62 |
+
"attention_dropout": 0.0,
|
| 63 |
+
"hidden_act": "quick_gelu",
|
| 64 |
+
"hidden_size": 8,
|
| 65 |
+
"image_size": 16,
|
| 66 |
+
"intermediate_size": 8,
|
| 67 |
+
"layer_norm_eps": 1e-05,
|
| 68 |
+
"layer_scale_init_value": 0.1,
|
| 69 |
+
"max_position_embeddings": 2704,
|
| 70 |
+
"mlp_ratio": 1.0,
|
| 71 |
+
"model_type": "step3p5_vision",
|
| 72 |
+
"num_attention_heads": 2,
|
| 73 |
+
"num_channels": 3,
|
| 74 |
+
"num_hidden_layers": 1,
|
| 75 |
+
"patch_size": 4,
|
| 76 |
+
"rope_parameters": {
|
| 77 |
+
"rope_theta": 10000.0,
|
| 78 |
+
"rope_type": "axial"
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a05ee98debab7c2f72cc64a4de015f0ee9509b7d3c3d39a2ce628c72edae88ca
|
| 3 |
+
size 8301400
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": null,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|begin▁of▁sentence|>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"is_local": true,
|
| 8 |
+
"legacy": true,
|
| 9 |
+
"local_files_only": false,
|
| 10 |
+
"model_max_length": 131072,
|
| 11 |
+
"pad_token": "<|end▁of▁sentence|>",
|
| 12 |
+
"sp_model_kwargs": {},
|
| 13 |
+
"tokenizer_class": "TokenizersBackend",
|
| 14 |
+
"unk_token": null,
|
| 15 |
+
"use_default_system_prompt": false
|
| 16 |
+
}
|