Upload 7 files
Browse filesFiles changed (8)
- .gitattributes+1
- chat_template.jinjaAdded+142
- config.jsonAdded+98
- generation_config.jsonAdded+12
- model.safetensorsAdded+3
- processor_config.jsonAdded+67
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+45
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142{%- macro render_content(content, is_system_content=false) -%} {%- if content is string -%} {{- content -}} {%- elif content is iterable and content is not mapping -%} {%- set ns = namespace(parts=[]) -%} {%- for item in content -%} {%- if 'image' in item or 'image_url' in item or item.type == 'image' -%} {%- if is_system_content -%} {{- raise_exception('System message cannot contain images.') -}} {%- endif -%} {%- set ns.parts = ns.parts + ['<|image_pad|>'] -%} {%- elif 'video' in item or item.type == 'video' -%} {%- if is_system_content -%} {{- raise_exception('System message cannot contain videos.') -}} {%- endif -%} {%- set ns.parts = ns.parts + ['<|video_pad|>'] -%} {%- elif 'text' in item -%} {%- set ns.parts = ns.parts + [item.text] -%} {%- else -%} {{- raise_exception('Unexpected item type in content.') -}} {%- endif -%} {%- endfor -%} {{- ns.parts | join('\n') -}} {%- elif content is none or content is undefined -%} {{- '' -}} {%- else -%} {{- raise_exception('Unexpected content type.') -}} {%- endif -%}{%- endmacro -%}{%- if not messages %} {{- raise_exception('No messages provided.') }}{%- endif %}{%- if tools and tools is iterable and tools is not mapping %} {{- '<|im_start|>system\n' }} {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }} {%- for tool in tools %} {{- "\n" }} {{- tool | tojson }} {%- endfor %} {{- "\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=...></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>' }} {%- if messages[0].role == 'system' %} {%- set content = render_content(messages[0].content, true)|trim %} {%- if content %} {{- '\n\n' + content }} {%- endif %} {%- endif %} {{- '<|im_end|>\n' }}{%- else %} {%- if messages[0].role == 'system' %} {%- set content = render_content(messages[0].content, true)|trim %} {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }} {%- endif %}{%- endif %}{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}{%- for message in messages[::-1] %} {%- set index = (messages|length - 1) - loop.index0 %} {%- if ns.multi_step_tool and message.role == "user" %} {%- set content = render_content(message.content)|trim %} {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %} {%- set ns.multi_step_tool = false %} {%- set ns.last_query_index = index %} {%- endif %} {%- endif %}{%- endfor %}{%- if ns.multi_step_tool %} {{- raise_exception('No user query found in messages.') }}{%- endif %}{%- for message in messages %} {%- set content = render_content(message.content)|trim %} {%- if message.role == "system" %} {%- if not loop.first %} {{- raise_exception('System message must be at the beginning.') }} {%- endif %} {%- elif message.role == "user" %} {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }} {%- elif message.role == "assistant" %} {%- set reasoning_content = '' %} {%- if message.reasoning_content is string %} {%- set reasoning_content = message.reasoning_content %} {%- else %} {%- if '</think>' in content %} {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %} {%- set content = content.split('</think>')[-1].lstrip('\n') %} {%- endif %} {%- endif %} {%- set reasoning_content = reasoning_content|trim %} {%- if loop.index0 > ns.last_query_index and reasoning_content %} {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }} {%- else %} {{- '<|im_start|>' + message.role + '\n<think>\n\n</think>\n\n' + content }} {%- endif %} {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %} {%- for tool_call in message.tool_calls %} {%- if tool_call.function is defined %} {%- set tool_call = tool_call.function %} {%- endif %} {%- if loop.first %} {%- if content|trim %} {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }} {%- else %} {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }} {%- endif %} {%- else %} {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }} {%- endif %} {%- if tool_call.arguments is defined %} {%- for args_name, args_value in tool_call.arguments|items %} {{- '<parameter=' + args_name + '>\n' }} {%- 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 %} {{- args_value }} {{- '\n</parameter>\n' }} {%- endfor %} {%- endif %} {{- '</function>\n</tool_call>' }} {%- endfor %} {%- endif %} {{- '<|im_end|>\n' }} {%- elif message.role == "tool" %} {%- if loop.previtem and loop.previtem.role != "tool" %} {{- '<|im_start|>user' }} {%- endif %} {{- '\n<tool_response>\n' }} {{- content }} {{- '\n</tool_response>' }} {%- if not loop.last and loop.nextitem.role != "tool" %} {{- '<|im_end|>\n' }} {%- elif loop.last %} {{- '<|im_end|>\n' }} {%- endif %} {%- else %} {{- raise_exception('Unexpected message role.') }} {%- endif %}{%- endfor %}{%- if add_generation_prompt %} {{- '<|im_start|>assistant\n' }} {%- if enable_thinking is defined and enable_thinking is false %} {{- '<think>\n\n</think>\n\n' }} {%- else %} {{- '<think>\n' }} {%- endif %}{%- endif %}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798{ "architectures": [ "MiniCPMV4_7ForConditionalGeneration" ], "downsample_mode": "16x", "dtype": "float32", "image_end_id": null, "image_size": 448, "image_start_id": null, "image_token_id": 248056, "insert_layer_id": 1, "merge_kernel_size": [ 2, 2 ], "merger_times": 1, "model_type": "minicpmv4_7", "mrope_mode": "canvas", "newline_id": null, "patch_size": 14, "slice_end_id": null, "slice_start_id": null, "text_config": { "attention_bias": false, "attention_dropout": 0.0, "attn_output_gate": true, "bos_token_id": null, "eos_token_id": null, "full_attention_interval": 4, "head_dim": 32, "hidden_act": "silu", "hidden_size": 8, "initializer_range": 0.02, "layer_types": [ "linear_attention", "linear_attention", "linear_attention", "full_attention" ], "linear_conv_kernel_dim": 4, "linear_key_head_dim": 8, "linear_num_key_heads": 2, "linear_num_value_heads": 4, "linear_value_head_dim": 8, "mamba_ssm_dtype": "float32", "max_position_embeddings": 262144, "model_type": "qwen3_5_moe_text", "moe_intermediate_size": 16, "mtp_num_hidden_layers": 0, "mtp_use_dedicated_embeddings": false, "num_attention_heads": 2, "num_experts": 8, "num_experts_per_tok": 2, "num_hidden_layers": 4, "num_key_value_heads": 1, "output_router_logits": false, "pad_token_id": null, "partial_rotary_factor": 0.25, "rms_norm_eps": 1e-06, "rope_parameters": { "mrope_interleaved": true, "mrope_section": [ 2, 1, 1 ], "partial_rotary_factor": 0.25, "rope_theta": 10000000, "rope_type": "default" }, "router_aux_loss_coef": 0.001, "shared_expert_intermediate_size": 16, "tie_word_embeddings": true, "use_cache": true, "vocab_size": 248144 }, "tie_word_embeddings": true, "transformers_version": "5.18.0.dev0", "video_token_id": 248057, "vision_config": { "attention_dropout": 0.0, "hidden_act": "gelu_pytorch_tanh", "hidden_size": 16, "image_size": 980, "insert_layer_id": 1, "intermediate_size": 32, "layer_norm_eps": 1e-06, "model_type": "minicpmv4_7_vision", "num_attention_heads": 2, "num_channels": 3, "num_hidden_layers": 3, "patch_size": 14, "window_kernel_size": [ 2, 2 ] }}123456789101112{ "bos_token_id": 248045, "do_sample": true, "eos_token_id": [ 248044, 248046 ], "temperature": 1.0, "top_k": 20, "top_p": 0.95, "transformers_version": "5.9.0"}123version https://git-lfs.github.com/spec/v1oid sha256:053d492ffa72433c96658dd1600d204f9c2853c4fb8986194646ba38a5569dd4size 849461612345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667{ "image_processor": { "auto_map": { "AutoImageProcessor": "image_processing_minicpmv4_7.MiniCPMV4_7ImageProcessor", "AutoVideoProcessor": "video_processing_minicpmv4_7.MiniCPMV4_7VideoProcessor" }, "do_convert_rgb": true, "do_normalize": true, "do_rescale": true, "do_resize": true, "downsample_mode": "16x", "image_mean": [ 0.5, 0.5, 0.5 ], "image_processor_type": "MiniCPMV4_6ImageProcessor", "image_std": [ 0.5, 0.5, 0.5 ], "max_slice_nums": 9, "mrope_mode": "canvas", "patch_size": 14, "resample": 3, "rescale_factor": 0.00392156862745098, "scale_resolution": 448, "slice_mode": true, "use_image_id": true }, "processor_class": "MiniCPMV4_7Processor", "video_processor": { "auto_map": { "AutoImageProcessor": "image_processing_minicpmv4_7.MiniCPMV4_7ImageProcessor", "AutoVideoProcessor": "video_processing_minicpmv4_7.MiniCPMV4_7VideoProcessor" }, "do_convert_rgb": true, "do_normalize": true, "do_rescale": true, "do_resize": true, "do_sample_frames": true, "downsample_mode": "16x", "image_mean": [ 0.5, 0.5, 0.5 ], "image_std": [ 0.5, 0.5, 0.5 ], "max_num_frames": 128, "max_slice_nums": 9, "mrope_mode": "canvas", "patch_size": 14, "resample": 3, "rescale_factor": 0.00392156862745098, "return_metadata": false, "scale_resolution": 448, "slice_mode": true, "stack_frames": 1, "use_image_id": true, "video_processor_type": "MiniCPMV4_6VideoProcessor" }}123version https://git-lfs.github.com/spec/v1oid sha256:e4608c5d7b3f4f30ba83be16a82cdac856b2e7191d40f0a08cbacc76c2a926eesize 20001935123456789101112131415161718192021222324252627282930313233343536373839404142434445{ "add_prefix_space": false, "audio_bos_token": "<|audio_start|>", "audio_eos_token": "<|audio_end|>", "audio_token": "<|audio_pad|>", "backend": "tokenizers", "bos_token": "<|im_start|>", "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "errors": "replace", "image_end_token": "</image>", "image_id_end_token": "</image_id>", "image_id_start_token": "<image_id>", "image_start_token": "<image>", "image_token": "<|image_pad|>", "is_local": true, "local_files_only": false, "model_max_length": 262144, "model_specific_special_tokens": { "audio_bos_token": "<|audio_start|>", "audio_eos_token": "<|audio_end|>", "audio_token": "<|audio_pad|>", "image_end_token": "</image>", "image_id_end_token": "</image_id>", "image_id_start_token": "<image_id>", "image_start_token": "<image>", "image_token": "<|image_pad|>", "slice_end_token": "</slice>", "slice_start_token": "<slice>", "video_token": "<|video_pad|>", "vision_bos_token": "<|vision_start|>", "vision_eos_token": "<|vision_end|>" }, "pad_token": "<|endoftext|>", "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+", "processor_class": "MiniCPMV4_7Processor", "slice_end_token": "</slice>", "slice_start_token": "<slice>", "split_special_tokens": false, "tokenizer_class": "TokenizersBackend", "unk_token": "<unk>", "video_token": "<|video_pad|>", "vision_bos_token": "<|vision_start|>", "vision_eos_token": "<|vision_end|>"}.gitattributes+1
chat_template.jinjaAdded+142
config.jsonAdded+98
generation_config.jsonAdded+12
model.safetensorsAdded+3
processor_config.jsonAdded+67
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+45