Commit
•
46e4d81
1
Parent(s):
13d78ed
Upload folder using huggingface_hub
Browse files- README.md +19 -0
- added_tokens.json +3 -0
- config.json +72 -0
- model-00001-of-00004.safetensors +3 -0
- model-00002-of-00004.safetensors +3 -0
- model-00003-of-00004.safetensors +3 -0
- model-00004-of-00004.safetensors +3 -0
- model.safetensors.index.json +0 -0
- preprocessor_config.json +52 -0
- special_tokens_map.json +33 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +73 -0
README.md
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- vision
|
4 |
+
- image-text-to-text
|
5 |
+
- mlx
|
6 |
+
---
|
7 |
+
|
8 |
+
# mlx-community/llava-v1.6-34b-4bit
|
9 |
+
This model was converted to MLX format from [`llava-hf/llava-v1.6-34b-hf`]() using mlx-vlm version **0.0.9**.
|
10 |
+
Refer to the [original model card](https://huggingface.co/llava-hf/llava-v1.6-34b-hf) 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/llava-v1.6-34b-4bit --max-tokens 100 --temp 0.0
|
19 |
+
```
|
added_tokens.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<image>": 64000
|
3 |
+
}
|
config.json
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"LlavaNextForConditionalGeneration"
|
4 |
+
],
|
5 |
+
"ignore_index": -100,
|
6 |
+
"image_grid_pinpoints": [
|
7 |
+
[
|
8 |
+
336,
|
9 |
+
672
|
10 |
+
],
|
11 |
+
[
|
12 |
+
672,
|
13 |
+
336
|
14 |
+
],
|
15 |
+
[
|
16 |
+
672,
|
17 |
+
672
|
18 |
+
],
|
19 |
+
[
|
20 |
+
1008,
|
21 |
+
336
|
22 |
+
],
|
23 |
+
[
|
24 |
+
336,
|
25 |
+
1008
|
26 |
+
]
|
27 |
+
],
|
28 |
+
"image_token_index": 64000,
|
29 |
+
"model_type": "llava_next",
|
30 |
+
"projector_hidden_act": "gelu",
|
31 |
+
"quantization": {
|
32 |
+
"group_size": 64,
|
33 |
+
"bits": 4
|
34 |
+
},
|
35 |
+
"text_config": {
|
36 |
+
"_name_or_path": "NousResearch/Nous-Hermes-2-Yi-34B",
|
37 |
+
"architectures": [
|
38 |
+
"LlamaForCausalLM"
|
39 |
+
],
|
40 |
+
"eos_token_id": 7,
|
41 |
+
"hidden_size": 7168,
|
42 |
+
"intermediate_size": 20480,
|
43 |
+
"max_position_embeddings": 4096,
|
44 |
+
"model_type": "llama",
|
45 |
+
"num_attention_heads": 56,
|
46 |
+
"num_hidden_layers": 60,
|
47 |
+
"num_key_value_heads": 8,
|
48 |
+
"pad_token_id": 0,
|
49 |
+
"rms_norm_eps": 1e-05,
|
50 |
+
"rope_theta": 5000000.0,
|
51 |
+
"torch_dtype": "bfloat16",
|
52 |
+
"use_cache": false,
|
53 |
+
"vocab_size": 64064
|
54 |
+
},
|
55 |
+
"torch_dtype": "float16",
|
56 |
+
"transformers_version": "4.39.0.dev0",
|
57 |
+
"use_image_newline_parameter": true,
|
58 |
+
"vision_config": {
|
59 |
+
"hidden_size": 1024,
|
60 |
+
"image_size": 336,
|
61 |
+
"intermediate_size": 4096,
|
62 |
+
"model_type": "clip_vision_model",
|
63 |
+
"num_attention_heads": 16,
|
64 |
+
"num_hidden_layers": 24,
|
65 |
+
"patch_size": 14,
|
66 |
+
"projection_dim": 768,
|
67 |
+
"vocab_size": 32000
|
68 |
+
},
|
69 |
+
"vision_feature_layer": -2,
|
70 |
+
"vision_feature_select_strategy": "default",
|
71 |
+
"vocab_size": 64064
|
72 |
+
}
|
model-00001-of-00004.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:108c766bd21bbff42ea87c2689072ff4184e2d91b991a6ebdfe6fb92806b9991
|
3 |
+
size 5364351195
|
model-00002-of-00004.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:47b2bd3882edd01afb349fec6b4d9832f6afea32cbcbc2ee1edd52521653ec11
|
3 |
+
size 5339493956
|
model-00003-of-00004.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4209068dd47bd74af230dbce910913675cb3af581cb1525f902de15527f9367e
|
3 |
+
size 5334906300
|
model-00004-of-00004.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:394feac802614565b6545561792e44e9512a36d1b8c62b5b04a539647df82fad
|
3 |
+
size 3512179768
|
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,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"aspect_ratio_setting": "anyres",
|
3 |
+
"crop_size": {
|
4 |
+
"height": 336,
|
5 |
+
"width": 336
|
6 |
+
},
|
7 |
+
"do_center_crop": true,
|
8 |
+
"do_convert_rgb": true,
|
9 |
+
"do_normalize": true,
|
10 |
+
"do_pad": true,
|
11 |
+
"do_rescale": true,
|
12 |
+
"do_resize": true,
|
13 |
+
"image_grid_pinpoints": [
|
14 |
+
[
|
15 |
+
336,
|
16 |
+
672
|
17 |
+
],
|
18 |
+
[
|
19 |
+
672,
|
20 |
+
336
|
21 |
+
],
|
22 |
+
[
|
23 |
+
672,
|
24 |
+
672
|
25 |
+
],
|
26 |
+
[
|
27 |
+
1008,
|
28 |
+
336
|
29 |
+
],
|
30 |
+
[
|
31 |
+
336,
|
32 |
+
1008
|
33 |
+
]
|
34 |
+
],
|
35 |
+
"image_mean": [
|
36 |
+
0.48145466,
|
37 |
+
0.4578275,
|
38 |
+
0.40821073
|
39 |
+
],
|
40 |
+
"image_processor_type": "LlavaNextImageProcessor",
|
41 |
+
"image_std": [
|
42 |
+
0.26862954,
|
43 |
+
0.26130258,
|
44 |
+
0.27577711
|
45 |
+
],
|
46 |
+
"processor_class": "LlavaNextProcessor",
|
47 |
+
"resample": 3,
|
48 |
+
"rescale_factor": 0.00392156862745098,
|
49 |
+
"size": {
|
50 |
+
"shortest_edge": 336
|
51 |
+
}
|
52 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<image>"
|
4 |
+
],
|
5 |
+
"bos_token": {
|
6 |
+
"content": "<|startoftext|>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"eos_token": {
|
13 |
+
"content": "<|im_end|>",
|
14 |
+
"lstrip": false,
|
15 |
+
"normalized": false,
|
16 |
+
"rstrip": false,
|
17 |
+
"single_word": false
|
18 |
+
},
|
19 |
+
"pad_token": {
|
20 |
+
"content": "<unk>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false
|
25 |
+
},
|
26 |
+
"unk_token": {
|
27 |
+
"content": "<unk>",
|
28 |
+
"lstrip": false,
|
29 |
+
"normalized": false,
|
30 |
+
"rstrip": false,
|
31 |
+
"single_word": false
|
32 |
+
}
|
33 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:386c49cf943d71aa110361135338c50e38beeff0a66593480421f37b319e1a39
|
3 |
+
size 1033105
|
tokenizer_config.json
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": false,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": true,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<|startoftext|>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "<|endoftext|>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
},
|
30 |
+
"6": {
|
31 |
+
"content": "<|im_start|>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": false
|
37 |
+
},
|
38 |
+
"7": {
|
39 |
+
"content": "<|im_end|>",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": false,
|
42 |
+
"rstrip": false,
|
43 |
+
"single_word": false,
|
44 |
+
"special": true
|
45 |
+
},
|
46 |
+
"64000": {
|
47 |
+
"content": "<image>",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": false,
|
50 |
+
"rstrip": false,
|
51 |
+
"single_word": false,
|
52 |
+
"special": true
|
53 |
+
}
|
54 |
+
},
|
55 |
+
"additional_special_tokens": [
|
56 |
+
"<image>"
|
57 |
+
],
|
58 |
+
"bos_token": "<|startoftext|>",
|
59 |
+
"chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
60 |
+
"clean_up_tokenization_spaces": false,
|
61 |
+
"eos_token": "<|im_end|>",
|
62 |
+
"legacy": true,
|
63 |
+
"model_max_length": 4096,
|
64 |
+
"pad_token": "<unk>",
|
65 |
+
"processor_class": "LlavaNextProcessor",
|
66 |
+
"sp_model_kwargs": {},
|
67 |
+
"spaces_between_special_tokens": false,
|
68 |
+
"tokenizer_class": "LlamaTokenizer",
|
69 |
+
"trust_remote_code": false,
|
70 |
+
"unk_token": "<unk>",
|
71 |
+
"use_default_system_prompt": false,
|
72 |
+
"use_fast": true
|
73 |
+
}
|