prince-canuma commited on
Commit
c9cfa44
1 Parent(s): 2b7d449

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - vision
5
+ - image-text-to-text
6
+ - mlx
7
+ ---
8
+
9
+ # mlx-community/llava-v1.6-mistral-7b-4bit
10
+ This model was converted to MLX format from [`llava-hf/llava-v1.6-mistral-7b-hf`]() using mlx-vlm version **0.0.9**.
11
+ Refer to the [original model card](https://huggingface.co/llava-hf/llava-v1.6-mistral-7b-hf) for more details on the model.
12
+ ## Use with mlx
13
+
14
+ ```bash
15
+ pip install -U mlx-vlm
16
+ ```
17
+
18
+ ```bash
19
+ python -m mlx_vlm.generate --model mlx-community/llava-v1.6-mistral-7b-4bit --max-tokens 100 --temp 0.0
20
+ ```
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<image>": 32000,
3
+ "<pad>": 32001
4
+ }
config.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": 32000,
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": "mistralai/Mistral-7B-Instruct-v0.2",
37
+ "architectures": [
38
+ "MistralForCausalLM"
39
+ ],
40
+ "intermediate_size": 14336,
41
+ "max_position_embeddings": 32768,
42
+ "model_type": "mistral",
43
+ "num_key_value_heads": 8,
44
+ "rms_norm_eps": 1e-05,
45
+ "rope_theta": 1000000.0,
46
+ "sliding_window": null,
47
+ "torch_dtype": "bfloat16",
48
+ "vocab_size": 32064
49
+ },
50
+ "torch_dtype": "float16",
51
+ "transformers_version": "4.39.0.dev0",
52
+ "use_image_newline_parameter": true,
53
+ "vision_config": {
54
+ "hidden_size": 1024,
55
+ "image_size": 336,
56
+ "intermediate_size": 4096,
57
+ "model_type": "clip_vision_model",
58
+ "num_attention_heads": 16,
59
+ "num_hidden_layers": 24,
60
+ "patch_size": 14,
61
+ "projection_dim": 768,
62
+ "vocab_size": 32000
63
+ },
64
+ "vision_feature_layer": -2,
65
+ "vision_feature_select_strategy": "default",
66
+ "vocab_size": 32064
67
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c067c64c4cc2ab04af36a9c0a2cb528efc89ed0828a4a5df1332522ef5d3f62
3
+ size 4258218323
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,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "pad_token": {
17
+ "content": "<pad>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
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:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "32000": {
30
+ "content": "<image>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "32001": {
38
+ "content": "<pad>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ }
45
+ },
46
+ "additional_special_tokens": [],
47
+ "bos_token": "<s>",
48
+ "chat_template": "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token}}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}",
49
+ "clean_up_tokenization_spaces": false,
50
+ "eos_token": "</s>",
51
+ "max_length": null,
52
+ "model_max_length": 1000000000000000019884624838656,
53
+ "pad_to_multiple_of": null,
54
+ "pad_token": "<pad>",
55
+ "pad_token_type_id": 0,
56
+ "padding_side": "left",
57
+ "processor_class": "LlavaNextProcessor",
58
+ "sp_model_kwargs": {},
59
+ "spaces_between_special_tokens": false,
60
+ "tokenizer_class": "LlamaTokenizer",
61
+ "unk_token": "<unk>",
62
+ "use_default_system_prompt": false
63
+ }