{ "context_length": 4096, "prefill_length": 256, "batch_size": 1, "hidden_size": 2048, "vocab_size": 65536, "num_attention_heads": 32, "num_key_value_heads": 8, "head_dim": 64, "conv_kernel_size": 3, "bos_token_id": 1, "eos_token_id": 7, "pad_token_id": 0, "image_token_id": 396, "image_start_token_id": 498, "image_end_token_id": 499, "image_thumbnail_token_id": 497, "tile_size": 512, "encoder_patch_size": 16, "downsample_factor": 2, "min_tiles": 2, "max_tiles": 10, "use_thumbnail": true, "min_image_tokens": 64, "max_image_tokens": 256, "max_num_patches": 1024, "vision_hidden_size": 1152, "projector_hidden_size": 2048, "vision_position_embedding_size": 16, "vision_patch_embedding_model": "VisionPatchEmbedding.mlpackage", "vision_encoder_model": "VisionEncoder.mlpackage", "vision_projector_model": "VisionProjector.mlpackage", "vision_position_embeddings_file": "VisionPositionEmbeddings.float16.bin", "chunk_order": [ "DecoderChunk0", "DecoderChunk1", "DecoderChunk2", "DecoderChunk3" ], "chunks": [ { "name": "DecoderChunk0", "start_layer": 0, "end_layer": 4, "conv_layer_indices": [ 0, 1, 3 ], "attention_layer_indices": [ 2 ] }, { "name": "DecoderChunk1", "start_layer": 4, "end_layer": 8, "conv_layer_indices": [ 4, 6, 7 ], "attention_layer_indices": [ 5 ] }, { "name": "DecoderChunk2", "start_layer": 8, "end_layer": 12, "conv_layer_indices": [ 9, 11 ], "attention_layer_indices": [ 8, 10 ] }, { "name": "DecoderChunk3", "start_layer": 12, "end_layer": 16, "conv_layer_indices": [ 13, 15 ], "attention_layer_indices": [ 12, 14 ] } ], "layer_types": [ "conv", "conv", "full_attention", "conv", "conv", "full_attention", "conv", "conv", "full_attention", "conv", "full_attention", "conv", "full_attention", "conv", "full_attention", "conv" ], "embeddings_model": "Embeddings.mlpackage", "lm_head_model": "LMHead.mlpackage", "prefill_models": [ "DecoderChunk0Prefill.mlpackage", "DecoderChunk1Prefill.mlpackage", "DecoderChunk2Prefill.mlpackage", "DecoderChunk3Prefill.mlpackage" ], "decode_models": [ "DecoderChunk0Decode.mlpackage", "DecoderChunk1Decode.mlpackage", "DecoderChunk2Decode.mlpackage", "DecoderChunk3Decode.mlpackage" ], "chat_template": "{{- bos_token -}}\n{%- set keep_past_thinking = keep_past_thinking | default(false) -%}\n{%- set ns = namespace(system_prompt=\"\") -%}\n{%- if messages[0][\"role\"] == \"system\" -%}\n {%- set sys_content = messages[0][\"content\"] -%}\n {%- if sys_content is not string -%}\n {%- for item in sys_content -%}\n {%- if item[\"type\"] == \"text\" -%}\n {%- set ns.system_prompt = ns.system_prompt + item[\"text\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {%- set ns.system_prompt = sys_content -%}\n {%- endif -%}\n {%- set messages = messages[1:] -%}\n{%- endif -%}\n{%- if tools -%}\n {%- set ns.system_prompt = ns.system_prompt + (\"\\n\" if ns.system_prompt else \"\") + \"List of tools: [\" -%}\n {%- for tool in tools -%}\n {%- if tool is not string -%}\n {%- set tool = tool | tojson -%}\n {%- endif -%}\n {%- set ns.system_prompt = ns.system_prompt + tool -%}\n {%- if not loop.last -%}\n {%- set ns.system_prompt = ns.system_prompt + \", \" -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set ns.system_prompt = ns.system_prompt + \"]\" -%}\n{%- endif -%}\n{%- if ns.system_prompt -%}\n {{- \"<|im_start|>system\\n\" + ns.system_prompt + \"<|im_end|>\\n\" -}}\n{%- endif -%}\n{%- set ns.last_assistant_index = -1 -%}\n{%- for message in messages -%}\n {%- if message[\"role\"] == \"assistant\" -%}\n {%- set ns.last_assistant_index = loop.index0 -%}\n {%- endif -%}\n{%- endfor -%}\n{%- for message in messages -%}\n {{- \"<|im_start|>\" + message[\"role\"] + \"\\n\" -}}\n {%- if message[\"content\"] is not string -%}\n {%- set ns.content = \"\" -%}\n {%- for item in message[\"content\"] -%}\n {%- if item[\"type\"] == \"image\" -%}\n {%- set ns.content = ns.content + \"\" -%}\n {%- elif item[\"type\"] == \"text\" -%}\n {%- set ns.content = ns.content + item[\"text\"] -%}\n {%- else -%}\n {%- set ns.content = ns.content + item | tojson -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set content = ns.content -%}\n {%- else -%}\n {%- set content = message[\"content\"] -%}\n {%- endif -%}\n {%- if message[\"role\"] == \"assistant\" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}\n {%- if \"\" in content -%}\n {%- set content = content.split(\"\")[-1] | trim -%}\n {%- endif -%}\n {%- endif -%}\n {{- content + \"<|im_end|>\\n\" -}}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{- \"<|im_start|>assistant\\n\" -}}\n{%- endif -%}" }