Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- chat_template.jinja +121 -0
- config.json +69 -0
- model.safetensors +3 -0
- processor_config.json +32 -0
- tokenizer.json +3 -0
- tokenizer_config.json +14 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{#- Default system message if no system prompt is passed. #}
|
| 2 |
+
{%- set default_system_message = '' %}
|
| 3 |
+
|
| 4 |
+
{#- Begin of sequence token. #}
|
| 5 |
+
{{- bos_token }}
|
| 6 |
+
|
| 7 |
+
{#- Handle system prompt if it exists. #}
|
| 8 |
+
{#- System prompt supports text content or text chunks. #}
|
| 9 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 10 |
+
{{- '[SYSTEM_PROMPT]' -}}
|
| 11 |
+
{%- if messages[0]['content'] is string %}
|
| 12 |
+
{{- messages[0]['content'] -}}
|
| 13 |
+
{%- else %}
|
| 14 |
+
{%- for block in messages[0]['content'] %}
|
| 15 |
+
{%- if block['type'] == 'text' %}
|
| 16 |
+
{{- block['text'] }}
|
| 17 |
+
{%- else %}
|
| 18 |
+
{{- raise_exception('Only text chunks are supported in system message contents.') }}
|
| 19 |
+
{%- endif %}
|
| 20 |
+
{%- endfor %}
|
| 21 |
+
{%- endif %}
|
| 22 |
+
{{- '[/SYSTEM_PROMPT]' -}}
|
| 23 |
+
{%- set loop_messages = messages[1:] %}
|
| 24 |
+
{%- else %}
|
| 25 |
+
{%- set loop_messages = messages %}
|
| 26 |
+
{%- if default_system_message != '' %}
|
| 27 |
+
{{- '[SYSTEM_PROMPT]' + default_system_message + '[/SYSTEM_PROMPT]' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{%- endif %}
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
{#- Tools definition #}
|
| 33 |
+
{%- set tools_definition = '' %}
|
| 34 |
+
{%- set has_tools = false %}
|
| 35 |
+
{%- if tools is defined and tools is not none and tools|length > 0 %}
|
| 36 |
+
{%- set has_tools = true %}
|
| 37 |
+
{%- set tools_definition = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %}
|
| 38 |
+
{{- tools_definition }}
|
| 39 |
+
{%- endif %}
|
| 40 |
+
|
| 41 |
+
{#- Checks for alternating user/assistant messages. #}
|
| 42 |
+
{%- set ns = namespace(index=0) %}
|
| 43 |
+
{%- for message in loop_messages %}
|
| 44 |
+
{%- if message.role == 'user' or (message.role == 'assistant' and (message.tool_calls is not defined or message.tool_calls is none or message.tool_calls | length == 0)) %}
|
| 45 |
+
{%- if (message['role'] == 'user') != (ns.index % 2 == 0) %}
|
| 46 |
+
{{- raise_exception('After the optional system message, conversation roles must alternate user and assistant roles except for tool calls and results.') }}
|
| 47 |
+
{%- endif %}
|
| 48 |
+
{%- set ns.index = ns.index + 1 %}
|
| 49 |
+
{%- endif %}
|
| 50 |
+
{%- endfor %}
|
| 51 |
+
|
| 52 |
+
{#- Handle conversation messages. #}
|
| 53 |
+
{%- for message in loop_messages %}
|
| 54 |
+
|
| 55 |
+
{#- User messages supports text content or text and image chunks. #}
|
| 56 |
+
{%- if message['role'] == 'user' %}
|
| 57 |
+
{%- if message['content'] is string %}
|
| 58 |
+
{{- '[INST]' + message['content'] + '[/INST]' }}
|
| 59 |
+
{%- elif message['content'] | length > 0 %}
|
| 60 |
+
{{- '[INST]' }}
|
| 61 |
+
{%- if message['content'] | length == 2 %}
|
| 62 |
+
{%- set blocks = message['content'] | sort(attribute='type') %}
|
| 63 |
+
{%- else %}
|
| 64 |
+
{%- set blocks = message['content'] %}
|
| 65 |
+
{%- endif %}
|
| 66 |
+
{%- for block in blocks %}
|
| 67 |
+
{%- if block['type'] == 'text' %}
|
| 68 |
+
{{- block['text'] }}
|
| 69 |
+
{%- elif block['type'] in ['image', 'image_url'] %}
|
| 70 |
+
{{- '[IMG]' }}
|
| 71 |
+
{%- else %}
|
| 72 |
+
{{- raise_exception('Only text, image and image_url chunks are supported in user message content.') }}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{%- endfor %}
|
| 75 |
+
{{- '[/INST]' }}
|
| 76 |
+
{%- else %}
|
| 77 |
+
{{- raise_exception('User message must have a string or a list of chunks in content') }}
|
| 78 |
+
{%- endif %}
|
| 79 |
+
|
| 80 |
+
{#- Assistant messages supports text content or text and image chunks. #}
|
| 81 |
+
{%- elif message['role'] == 'assistant' %}
|
| 82 |
+
{%- if (message['content'] is none or message['content'] == '' or message['content']|length == 0) and (message['tool_calls'] is not defined or message['tool_calls'] is none or message['tool_calls']|length == 0) %}
|
| 83 |
+
{{- raise_exception('Assistant message must have a string or a list of chunks in content or a list of tool calls.') }}
|
| 84 |
+
{%- endif %}
|
| 85 |
+
|
| 86 |
+
{%- if message['content'] is string %}
|
| 87 |
+
{{- message['content'] }}
|
| 88 |
+
{%- elif message['content'] | length > 0 %}
|
| 89 |
+
{%- for block in message['content'] %}
|
| 90 |
+
{%- if block['type'] == 'text' %}
|
| 91 |
+
{{- block['text'] }}
|
| 92 |
+
{%- else %}
|
| 93 |
+
{{- raise_exception('Only text chunks are supported in assistant message contents.') }}
|
| 94 |
+
{%- endif %}
|
| 95 |
+
{%- endfor %}
|
| 96 |
+
{%- endif %}
|
| 97 |
+
|
| 98 |
+
{%- if message['tool_calls'] is defined and message['tool_calls'] is not none and message['tool_calls']|length > 0 %}
|
| 99 |
+
{%- for tool in message['tool_calls'] %}
|
| 100 |
+
{%- set arguments = tool['function']['arguments'] %}
|
| 101 |
+
{%- if arguments is not string %}
|
| 102 |
+
{%- set arguments = arguments|tojson|safe %}
|
| 103 |
+
{%- elif arguments == '' %}
|
| 104 |
+
{%- set arguments = '{}' %}
|
| 105 |
+
{%- endif %}
|
| 106 |
+
{{- '[TOOL_CALLS]' + tool['function']['name'] + '[ARGS]' + arguments }}
|
| 107 |
+
{%- endfor %}
|
| 108 |
+
{%- endif %}
|
| 109 |
+
|
| 110 |
+
{#- End of sequence token for each assistant messages. #}
|
| 111 |
+
{{- eos_token }}
|
| 112 |
+
|
| 113 |
+
{#- Tool messages only supports text content. #}
|
| 114 |
+
{%- elif message['role'] == 'tool' %}
|
| 115 |
+
{{- '[TOOL_RESULTS]' + message['content']|string + '[/TOOL_RESULTS]' }}
|
| 116 |
+
|
| 117 |
+
{#- Raise exception for unsupported roles. #}
|
| 118 |
+
{%- else %}
|
| 119 |
+
{{- raise_exception('Only user, assistant and tool roles are supported, got ' + message['role'] + '.') }}
|
| 120 |
+
{%- endif %}
|
| 121 |
+
{%- endfor %}
|
config.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Mistral3ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"torch_dtype": "bfloat16",
|
| 6 |
+
"image_token_index": 10,
|
| 7 |
+
"model_name": "akoumpa/Devstral-Small-2-24B-Instruct-2512-BF16",
|
| 8 |
+
"model_type": "mistral3",
|
| 9 |
+
"multimodal_projector_bias": false,
|
| 10 |
+
"pad_token_id": 11,
|
| 11 |
+
"projector_hidden_act": "gelu",
|
| 12 |
+
"spatial_merge_size": 2,
|
| 13 |
+
"text_config": {
|
| 14 |
+
"attention_dropout": 0.0,
|
| 15 |
+
"bos_token_id": 1,
|
| 16 |
+
"torch_dtype": "bfloat16",
|
| 17 |
+
"eos_token_id": 2,
|
| 18 |
+
"head_dim": 128,
|
| 19 |
+
"hidden_act": "silu",
|
| 20 |
+
"hidden_size": 5120,
|
| 21 |
+
"initializer_range": 0.02,
|
| 22 |
+
"intermediate_size": 32768,
|
| 23 |
+
"max_position_embeddings": 393216,
|
| 24 |
+
"model_type": "ministral3",
|
| 25 |
+
"num_attention_heads": 32,
|
| 26 |
+
"num_hidden_layers": 40,
|
| 27 |
+
"num_key_value_heads": 8,
|
| 28 |
+
"pad_token_id": 11,
|
| 29 |
+
"rms_norm_eps": 1e-05,
|
| 30 |
+
"rope_parameters": {
|
| 31 |
+
"beta_fast": 32.0,
|
| 32 |
+
"beta_slow": 1.0,
|
| 33 |
+
"factor": 48.0,
|
| 34 |
+
"llama_4_scaling_beta": 0.1,
|
| 35 |
+
"mscale": 1.0,
|
| 36 |
+
"mscale_all_dim": 1.0,
|
| 37 |
+
"original_max_position_embeddings": 8192,
|
| 38 |
+
"rope_theta": 100000000.0,
|
| 39 |
+
"rope_type": "yarn",
|
| 40 |
+
"type": "yarn"
|
| 41 |
+
},
|
| 42 |
+
"sliding_window": null,
|
| 43 |
+
"tie_word_embeddings": false,
|
| 44 |
+
"use_cache": true,
|
| 45 |
+
"vocab_size": 131072
|
| 46 |
+
},
|
| 47 |
+
"tie_word_embeddings": false,
|
| 48 |
+
"unsloth_version": "2026.3.11",
|
| 49 |
+
"vision_config": {
|
| 50 |
+
"attention_dropout": 0.0,
|
| 51 |
+
"torch_dtype": "bfloat16",
|
| 52 |
+
"head_dim": 64,
|
| 53 |
+
"hidden_act": "silu",
|
| 54 |
+
"hidden_size": 1024,
|
| 55 |
+
"image_size": 1540,
|
| 56 |
+
"initializer_range": 0.02,
|
| 57 |
+
"intermediate_size": 4096,
|
| 58 |
+
"model_type": "pixtral",
|
| 59 |
+
"num_attention_heads": 16,
|
| 60 |
+
"num_channels": 3,
|
| 61 |
+
"num_hidden_layers": 24,
|
| 62 |
+
"patch_size": 14,
|
| 63 |
+
"rope_parameters": {
|
| 64 |
+
"rope_theta": 10000.0,
|
| 65 |
+
"rope_type": "default"
|
| 66 |
+
}
|
| 67 |
+
},
|
| 68 |
+
"vision_feature_layer": -1
|
| 69 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:571d4e3d4828701c083f4ae68143da21f6d686e4b336ef2feed9dee2b7519129
|
| 3 |
+
size 48022801424
|
processor_config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_break_token": "[IMG_BREAK]",
|
| 3 |
+
"image_end_token": "[IMG_END]",
|
| 4 |
+
"image_processor": {
|
| 5 |
+
"data_format": "channels_first",
|
| 6 |
+
"do_convert_rgb": true,
|
| 7 |
+
"do_normalize": true,
|
| 8 |
+
"do_rescale": true,
|
| 9 |
+
"do_resize": true,
|
| 10 |
+
"image_mean": [
|
| 11 |
+
0.48145466,
|
| 12 |
+
0.4578275,
|
| 13 |
+
0.40821073
|
| 14 |
+
],
|
| 15 |
+
"image_processor_type": "PixtralImageProcessorFast",
|
| 16 |
+
"image_std": [
|
| 17 |
+
0.26862954,
|
| 18 |
+
0.26130258,
|
| 19 |
+
0.27577711
|
| 20 |
+
],
|
| 21 |
+
"patch_size": 14,
|
| 22 |
+
"resample": 3,
|
| 23 |
+
"rescale_factor": 0.00392156862745098,
|
| 24 |
+
"size": {
|
| 25 |
+
"longest_edge": 1540
|
| 26 |
+
}
|
| 27 |
+
},
|
| 28 |
+
"image_token": "[IMG]",
|
| 29 |
+
"patch_size": 14,
|
| 30 |
+
"processor_class": "PixtralProcessor",
|
| 31 |
+
"spatial_merge_size": 2
|
| 32 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:286acad9b0e27fce778ac429763536accf618ccb6ed72963b6f94685e531c5c7
|
| 3 |
+
size 17077402
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<s>",
|
| 4 |
+
"eos_token": "</s>",
|
| 5 |
+
"extra_special_tokens": [],
|
| 6 |
+
"is_local": false,
|
| 7 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 8 |
+
"pad_token": "<pad>",
|
| 9 |
+
"padding_side": "left",
|
| 10 |
+
"processor_class": "PixtralProcessor",
|
| 11 |
+
"tokenizer_class": "TokenizersBackend",
|
| 12 |
+
"unk_token": "<unk>",
|
| 13 |
+
"chat_template": "{#- Default system message if no system prompt is passed. #}\n{%- set default_system_message = '' %}\n\n{#- Begin of sequence token. #}\n{{- bos_token }}\n\n{#- Handle system prompt if it exists. #}\n{#- System prompt supports text content or text chunks. #}\n{%- if messages[0]['role'] == 'system' %}\n {{- '[SYSTEM_PROMPT]' -}}\n {%- if messages[0]['content'] is string %}\n {{- messages[0]['content'] -}}\n {%- else %} \n {%- for block in messages[0]['content'] %}\n {%- if block['type'] == 'text' %}\n {{- block['text'] }}\n {%- else %}\n {{- raise_exception('Only text chunks are supported in system message contents.') }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '[/SYSTEM_PROMPT]' -}}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set loop_messages = messages %}\n {%- if default_system_message != '' %}\n {{- '[SYSTEM_PROMPT]' + default_system_message + '[/SYSTEM_PROMPT]' }}\n {%- endif %}\n{%- endif %}\n\n\n{#- Tools definition #}\n{%- set tools_definition = '' %}\n{%- set has_tools = false %}\n{%- if tools is defined and tools is not none and tools|length > 0 %}\n {%- set has_tools = true %}\n {%- set tools_definition = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %}\n {{- tools_definition }}\n{%- endif %}\n\n{#- Checks for alternating user/assistant messages. #}\n{%- set ns = namespace(index=0) %}\n{%- for message in loop_messages %}\n {%- if message.role == 'user' or (message.role == 'assistant' and (message.tool_calls is not defined or message.tool_calls is none or message.tool_calls | length == 0)) %}\n {%- if (message['role'] == 'user') != (ns.index % 2 == 0) %}\n {{- raise_exception('After the optional system message, conversation roles must alternate user and assistant roles except for tool calls and results.') }}\n {%- endif %}\n {%- set ns.index = ns.index + 1 %}\n {%- endif %}\n{%- endfor %}\n\n{#- Handle conversation messages. #}\n{%- for message in loop_messages %}\n\n {#- User messages supports text content or text and image chunks. #}\n {%- if message['role'] == 'user' %}\n {%- if message['content'] is string %}\n {{- '[INST]' + message['content'] + '[/INST]' }}\n {%- elif message['content'] | length > 0 %}\n {{- '[INST]' }}\n {%- if message['content'] | length == 2 %}\n {%- set blocks = message['content'] | sort(attribute='type') %}\n {%- else %}\n {%- set blocks = message['content'] %}\n {%- endif %}\n {%- for block in blocks %}\n {%- if block['type'] == 'text' %}\n {{- block['text'] }}\n {%- elif block['type'] in ['image', 'image_url'] %}\n {{- '[IMG]' }}\n {%- else %}\n {{- raise_exception('Only text, image and image_url chunks are supported in user message content.') }}\n {%- endif %}\n {%- endfor %}\n {{- '[/INST]' }}\n {%- else %}\n {{- raise_exception('User message must have a string or a list of chunks in content') }}\n {%- endif %}\n\n {#- Assistant messages supports text content or text and image chunks. #}\n {%- elif message['role'] == 'assistant' %}\n {%- if (message['content'] is none or message['content'] == '' or message['content']|length == 0) and (message['tool_calls'] is not defined or message['tool_calls'] is none or message['tool_calls']|length == 0) %}\n {{- raise_exception('Assistant message must have a string or a list of chunks in content or a list of tool calls.') }}\n {%- endif %}\n\n {%- if message['content'] is string %}\n {{- message['content'] }}\n {%- elif message['content'] | length > 0 %}\n {%- for block in message['content'] %}\n {%- if block['type'] == 'text' %}\n {{- block['text'] }}\n {%- else %}\n {{- raise_exception('Only text chunks are supported in assistant message contents.') }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n \n {%- if message['tool_calls'] is defined and message['tool_calls'] is not none and message['tool_calls']|length > 0 %}\n {%- for tool in message['tool_calls'] %}\n {%- set arguments = tool['function']['arguments'] %}\n {%- if arguments is not string %}\n {%- set arguments = arguments|tojson|safe %}\n {%- elif arguments == '' %}\n {%- set arguments = '{}' %}\n {%- endif %}\n {{- '[TOOL_CALLS]' + tool['function']['name'] + '[ARGS]' + arguments }}\n {%- endfor %}\n {%- endif %}\n\n {#- End of sequence token for each assistant messages. #}\n {{- eos_token }}\n\n {#- Tool messages only supports text content. #}\n {%- elif message['role'] == 'tool' %}\n {{- '[TOOL_RESULTS]' + message['content']|string + '[/TOOL_RESULTS]' }}\n\n {#- Raise exception for unsupported roles. #}\n {%- else %}\n {{- raise_exception('Only user, assistant and tool roles are supported, got ' + message['role'] + '.') }}\n {%- endif %}\n{%- endfor %}"
|
| 14 |
+
}
|