prince-canuma
commited on
Commit
•
79e24b6
1
Parent(s):
fa8b7bf
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +19 -0
- chat_template.json +3 -0
- config.json +44 -0
- model-00001-of-00003.safetensors +3 -0
- model-00002-of-00003.safetensors +3 -0
- model-00003-of-00003.safetensors +3 -0
- model.safetensors.index.json +0 -0
- preprocessor_config.json +27 -0
- processor_config.json +7 -0
- special_tokens_map.json +23 -0
- tokenizer.json +3 -0
- tokenizer_config.json +0 -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
|
README.md
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
pipeline_tag: image-text-to-text
|
4 |
+
tags:
|
5 |
+
- mlx
|
6 |
+
---
|
7 |
+
|
8 |
+
# mlx-community/pixtral-12b-8bit
|
9 |
+
This model was converted to MLX format from [`mistral-community/pixtral-12b`]() using mlx-vlm version **0.0.15**.
|
10 |
+
Refer to the [original model card](https://huggingface.co/mistral-community/pixtral-12b) for more details on the model.
|
11 |
+
## Use with mlx
|
12 |
+
|
13 |
+
```bash
|
14 |
+
pip install -U mlx-vlm
|
15 |
+
```
|
16 |
+
|
17 |
+
```bash
|
18 |
+
python -m mlx_vlm.generate --model mlx-community/pixtral-12b-8bit --max-tokens 100 --temp 0.0
|
19 |
+
```
|
chat_template.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"chat_template": "{%- if messages[0][\"role\"] == \"system\" %}\n {%- set system_message = messages[0][\"content\"] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set loop_messages = messages %}\n{%- endif %}\n\n{{- bos_token }}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}\n {{- raise_exception('After the optional system message, conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif %}\n {%- if message[\"role\"] == \"user\" %}\n {%- if loop.last and system_message is defined %}\n {{- \"[INST]\" + system_message + \"\n\n\" }}\n {%- else %}\n {{- \"[INST]\" }}\n {%- endif %}\n {%- if message[\"content\"] is not string %}\n {%- for chunk in message[\"content\"] %}\n {%- if chunk[\"type\"] == \"text\" %}\n {{- chunk[\"content\"] }}\n {%- elif chunk[\"type\"] == \"image\" %}\n {{- \"[IMG]\" }}\n {%- else %}\n {{- raise_exception(\"Unrecognized content type!\") }}\n {%- endif %}\n {%- endfor %}\n {%- else %}\n {{- message[\"content\"] }}\n {%- endif %}\n {{- \"[/INST]\" }}\n {%- elif message[\"role\"] == \"assistant\" %}\n {{- message[\"content\"] + eos_token}}\n {%- else %}\n {{- raise_exception(\"Only user and assistant roles are supported, with the exception of an initial optional system message!\") }}\n {%- endif %}\n{%- endfor %}"
|
3 |
+
}
|
config.json
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_commit_hash": null,
|
3 |
+
"architectures": [
|
4 |
+
"LlavaForConditionalGeneration"
|
5 |
+
],
|
6 |
+
"ignore_index": -100,
|
7 |
+
"image_seq_length": 1,
|
8 |
+
"image_token_index": 10,
|
9 |
+
"model_type": "pixtral",
|
10 |
+
"projector_hidden_act": "gelu",
|
11 |
+
"quantization": {
|
12 |
+
"group_size": 64,
|
13 |
+
"bits": 8
|
14 |
+
},
|
15 |
+
"text_config": {
|
16 |
+
"hidden_size": 5120,
|
17 |
+
"head_dim": 128,
|
18 |
+
"intermediate_size": 14336,
|
19 |
+
"is_composition": true,
|
20 |
+
"max_position_embeddings": 1024000,
|
21 |
+
"model_type": "mistral",
|
22 |
+
"num_hidden_layers": 40,
|
23 |
+
"num_key_value_heads": 8,
|
24 |
+
"rms_norm_eps": 1e-05,
|
25 |
+
"rope_theta": 1000000000.0,
|
26 |
+
"sliding_window": null,
|
27 |
+
"vocab_size": 131072
|
28 |
+
},
|
29 |
+
"torch_dtype": "bfloat16",
|
30 |
+
"transformers_version": null,
|
31 |
+
"vision_config": {
|
32 |
+
"head_dim": 64,
|
33 |
+
"hidden_act": "gelu",
|
34 |
+
"image_size": 1024,
|
35 |
+
"is_composition": true,
|
36 |
+
"model_type": "pixtral",
|
37 |
+
"patch_size": 16,
|
38 |
+
"rope_theta": 10000.0,
|
39 |
+
"tie_word_embeddings": false,
|
40 |
+
"intermediate_size": 4096
|
41 |
+
},
|
42 |
+
"vision_feature_layer": -1,
|
43 |
+
"vision_feature_select_strategy": "full"
|
44 |
+
}
|
model-00001-of-00003.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:46a2c10537b8bf257f46e81e2c125f7573a316029aea6c0de703f1ca03561dcf
|
3 |
+
size 5331997520
|
model-00002-of-00003.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:53bc19449015f51d12d196e5e78d587d6b3c3bf88d648443c07c1d69a065de8b
|
3 |
+
size 5368148885
|
model-00003-of-00003.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:71f31a97050897adc0af5bc6befed6267a01032eb3d5d887e87ac3e3f2467921
|
3 |
+
size 2776649628
|
model.safetensors.index.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
preprocessor_config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_convert_rgb": true,
|
3 |
+
"do_normalize": true,
|
4 |
+
"do_rescale": true,
|
5 |
+
"do_resize": true,
|
6 |
+
"image_mean": [
|
7 |
+
0.48145466,
|
8 |
+
0.4578275,
|
9 |
+
0.40821073
|
10 |
+
],
|
11 |
+
"image_processor_type": "PixtralImageProcessor",
|
12 |
+
"image_std": [
|
13 |
+
0.26862954,
|
14 |
+
0.26130258,
|
15 |
+
0.27577711
|
16 |
+
],
|
17 |
+
"patch_size": {
|
18 |
+
"height": 16,
|
19 |
+
"width": 16
|
20 |
+
},
|
21 |
+
"processor_class": "PixtralProcessor",
|
22 |
+
"resample": 3,
|
23 |
+
"rescale_factor": 0.00392156862745098,
|
24 |
+
"size": {
|
25 |
+
"longest_edge": 1024
|
26 |
+
}
|
27 |
+
}
|
processor_config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"image_break_token": "[IMG_BREAK]",
|
3 |
+
"image_end_token": "[IMG_END]",
|
4 |
+
"image_token": "[IMG]",
|
5 |
+
"patch_size": 16,
|
6 |
+
"processor_class": "PixtralProcessor"
|
7 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"unk_token": {
|
17 |
+
"content": "<unk>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
}
|
23 |
+
}
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fcdf3e6b96371b9a5c8673bdf2f1bc838b994b73a6fa995dca62196346aaddb5
|
3 |
+
size 17077311
|
tokenizer_config.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|