shashikanth-a
commited on
Upload folder using huggingface_hub
Browse files- README.md +27 -0
- added_tokens.json +4 -0
- chat_template.json +3 -0
- config.json +184 -0
- model.safetensors +3 -0
- model.safetensors.index.json +0 -0
- preprocessor_config.json +28 -0
- processor_config.json +6 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +61 -0
README.md
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: llava-hf/llava-1.5-7b-hf
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
library_name: transformers
|
6 |
+
pipeline_tag: image-text-to-text
|
7 |
+
license: llama2
|
8 |
+
tags:
|
9 |
+
- multimodal
|
10 |
+
- llava
|
11 |
+
- vision
|
12 |
+
- unsloth
|
13 |
+
- mlx
|
14 |
+
---
|
15 |
+
|
16 |
+
# shashikanth-a/llava-1.5-7b-hf-4bit
|
17 |
+
This model was converted to MLX format from [`unsloth/llava-1.5-7b-hf`]() using mlx-vlm version **0.1.3**.
|
18 |
+
Refer to the [original model card](https://huggingface.co/unsloth/llava-1.5-7b-hf) for more details on the model.
|
19 |
+
## Use with mlx
|
20 |
+
|
21 |
+
```bash
|
22 |
+
pip install -U mlx-vlm
|
23 |
+
```
|
24 |
+
|
25 |
+
```bash
|
26 |
+
python -m mlx_vlm.generate --model shashikanth-a/llava-1.5-7b-hf-4bit --max-tokens 100 --temp 0.0
|
27 |
+
```
|
added_tokens.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<image>": 32000,
|
3 |
+
"<pad>": 32001
|
4 |
+
}
|
chat_template.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"chat_template": "{% for message in messages %}{% if message['role'] != 'system' %}{{ message['role'].upper() + ': '}}{% endif %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>\n' }}{% endfor %}{# Render all text next #}{% if message['role'] != 'assistant' %}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ content['text'] + ' '}}{% endfor %}{% else %}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{% generation %}{{ content['text'] + ' '}}{% endgeneration %}{% endfor %}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'ASSISTANT:' }}{% endif %}"
|
3 |
+
}
|
config.json
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"LlavaForConditionalGeneration"
|
4 |
+
],
|
5 |
+
"ignore_index": -100,
|
6 |
+
"image_seq_length": 576,
|
7 |
+
"image_token_index": 32000,
|
8 |
+
"model_type": "llava",
|
9 |
+
"pad_token_id": 32001,
|
10 |
+
"projector_hidden_act": "gelu",
|
11 |
+
"quantization": {
|
12 |
+
"group_size": 64,
|
13 |
+
"bits": 4
|
14 |
+
},
|
15 |
+
"text_config": {
|
16 |
+
"_attn_implementation_autoset": false,
|
17 |
+
"_name_or_path": "lmsys/vicuna-7b-v1.5",
|
18 |
+
"add_cross_attention": false,
|
19 |
+
"architectures": [
|
20 |
+
"LlamaForCausalLM"
|
21 |
+
],
|
22 |
+
"attention_bias": false,
|
23 |
+
"attention_dropout": 0.0,
|
24 |
+
"bad_words_ids": null,
|
25 |
+
"begin_suppress_tokens": null,
|
26 |
+
"bos_token_id": 1,
|
27 |
+
"chunk_size_feed_forward": 0,
|
28 |
+
"cross_attention_hidden_size": null,
|
29 |
+
"decoder_start_token_id": null,
|
30 |
+
"diversity_penalty": 0.0,
|
31 |
+
"do_sample": false,
|
32 |
+
"early_stopping": false,
|
33 |
+
"encoder_no_repeat_ngram_size": 0,
|
34 |
+
"eos_token_id": 2,
|
35 |
+
"exponential_decay_length_penalty": null,
|
36 |
+
"finetuning_task": null,
|
37 |
+
"forced_bos_token_id": null,
|
38 |
+
"forced_eos_token_id": null,
|
39 |
+
"head_dim": 128,
|
40 |
+
"hidden_act": "silu",
|
41 |
+
"hidden_size": 4096,
|
42 |
+
"id2label": {
|
43 |
+
"0": "LABEL_0",
|
44 |
+
"1": "LABEL_1"
|
45 |
+
},
|
46 |
+
"initializer_range": 0.02,
|
47 |
+
"intermediate_size": 11008,
|
48 |
+
"is_decoder": false,
|
49 |
+
"is_encoder_decoder": false,
|
50 |
+
"label2id": {
|
51 |
+
"LABEL_0": 0,
|
52 |
+
"LABEL_1": 1
|
53 |
+
},
|
54 |
+
"length_penalty": 1.0,
|
55 |
+
"max_length": 20,
|
56 |
+
"max_position_embeddings": 4096,
|
57 |
+
"min_length": 0,
|
58 |
+
"mlp_bias": false,
|
59 |
+
"model_type": "llama",
|
60 |
+
"no_repeat_ngram_size": 0,
|
61 |
+
"num_attention_heads": 32,
|
62 |
+
"num_beam_groups": 1,
|
63 |
+
"num_beams": 1,
|
64 |
+
"num_hidden_layers": 32,
|
65 |
+
"num_key_value_heads": 32,
|
66 |
+
"num_return_sequences": 1,
|
67 |
+
"output_attentions": false,
|
68 |
+
"output_hidden_states": false,
|
69 |
+
"output_scores": false,
|
70 |
+
"pad_token_id": 32001,
|
71 |
+
"prefix": null,
|
72 |
+
"pretraining_tp": 1,
|
73 |
+
"problem_type": null,
|
74 |
+
"pruned_heads": {},
|
75 |
+
"remove_invalid_values": false,
|
76 |
+
"repetition_penalty": 1.0,
|
77 |
+
"return_dict": true,
|
78 |
+
"return_dict_in_generate": false,
|
79 |
+
"rms_norm_eps": 1e-05,
|
80 |
+
"rope_scaling": null,
|
81 |
+
"rope_theta": 10000.0,
|
82 |
+
"sep_token_id": null,
|
83 |
+
"suppress_tokens": null,
|
84 |
+
"task_specific_params": null,
|
85 |
+
"temperature": 1.0,
|
86 |
+
"tf_legacy_loss": false,
|
87 |
+
"tie_encoder_decoder": false,
|
88 |
+
"tie_word_embeddings": false,
|
89 |
+
"tokenizer_class": null,
|
90 |
+
"top_k": 50,
|
91 |
+
"top_p": 1.0,
|
92 |
+
"torch_dtype": "float16",
|
93 |
+
"torchscript": false,
|
94 |
+
"typical_p": 1.0,
|
95 |
+
"use_bfloat16": false,
|
96 |
+
"use_cache": true,
|
97 |
+
"vocab_size": 32064
|
98 |
+
},
|
99 |
+
"tie_word_embeddings": false,
|
100 |
+
"torch_dtype": "bfloat16",
|
101 |
+
"transformers_version": "4.46.3",
|
102 |
+
"unsloth_fixed": true,
|
103 |
+
"vision_config": {
|
104 |
+
"_attn_implementation_autoset": false,
|
105 |
+
"_name_or_path": "",
|
106 |
+
"add_cross_attention": false,
|
107 |
+
"architectures": null,
|
108 |
+
"attention_dropout": 0.0,
|
109 |
+
"bad_words_ids": null,
|
110 |
+
"begin_suppress_tokens": null,
|
111 |
+
"bos_token_id": null,
|
112 |
+
"chunk_size_feed_forward": 0,
|
113 |
+
"cross_attention_hidden_size": null,
|
114 |
+
"decoder_start_token_id": null,
|
115 |
+
"diversity_penalty": 0.0,
|
116 |
+
"do_sample": false,
|
117 |
+
"early_stopping": false,
|
118 |
+
"encoder_no_repeat_ngram_size": 0,
|
119 |
+
"eos_token_id": null,
|
120 |
+
"exponential_decay_length_penalty": null,
|
121 |
+
"finetuning_task": null,
|
122 |
+
"forced_bos_token_id": null,
|
123 |
+
"forced_eos_token_id": null,
|
124 |
+
"hidden_act": "quick_gelu",
|
125 |
+
"hidden_size": 1024,
|
126 |
+
"id2label": {
|
127 |
+
"0": "LABEL_0",
|
128 |
+
"1": "LABEL_1"
|
129 |
+
},
|
130 |
+
"image_size": 336,
|
131 |
+
"initializer_factor": 1.0,
|
132 |
+
"initializer_range": 0.02,
|
133 |
+
"intermediate_size": 4096,
|
134 |
+
"is_decoder": false,
|
135 |
+
"is_encoder_decoder": false,
|
136 |
+
"label2id": {
|
137 |
+
"LABEL_0": 0,
|
138 |
+
"LABEL_1": 1
|
139 |
+
},
|
140 |
+
"layer_norm_eps": 1e-05,
|
141 |
+
"length_penalty": 1.0,
|
142 |
+
"max_length": 20,
|
143 |
+
"min_length": 0,
|
144 |
+
"model_type": "clip_vision_model",
|
145 |
+
"no_repeat_ngram_size": 0,
|
146 |
+
"num_attention_heads": 16,
|
147 |
+
"num_beam_groups": 1,
|
148 |
+
"num_beams": 1,
|
149 |
+
"num_channels": 3,
|
150 |
+
"num_hidden_layers": 24,
|
151 |
+
"num_return_sequences": 1,
|
152 |
+
"output_attentions": false,
|
153 |
+
"output_hidden_states": false,
|
154 |
+
"output_scores": false,
|
155 |
+
"pad_token_id": 32001,
|
156 |
+
"patch_size": 14,
|
157 |
+
"prefix": null,
|
158 |
+
"problem_type": null,
|
159 |
+
"projection_dim": 768,
|
160 |
+
"pruned_heads": {},
|
161 |
+
"remove_invalid_values": false,
|
162 |
+
"repetition_penalty": 1.0,
|
163 |
+
"return_dict": true,
|
164 |
+
"return_dict_in_generate": false,
|
165 |
+
"sep_token_id": null,
|
166 |
+
"suppress_tokens": null,
|
167 |
+
"task_specific_params": null,
|
168 |
+
"temperature": 1.0,
|
169 |
+
"tf_legacy_loss": false,
|
170 |
+
"tie_encoder_decoder": false,
|
171 |
+
"tie_word_embeddings": true,
|
172 |
+
"tokenizer_class": null,
|
173 |
+
"top_k": 50,
|
174 |
+
"top_p": 1.0,
|
175 |
+
"torch_dtype": null,
|
176 |
+
"torchscript": false,
|
177 |
+
"typical_p": 1.0,
|
178 |
+
"use_bfloat16": false,
|
179 |
+
"vocab_size": 32000
|
180 |
+
},
|
181 |
+
"vision_feature_layer": -2,
|
182 |
+
"vision_feature_select_strategy": "default",
|
183 |
+
"vocab_size": 32064
|
184 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bdf0f404f419efb874d22b4cf233dc87e9b49602a8318ffc9bc65296e29f4aa9
|
3 |
+
size 3975094479
|
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,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"crop_size": {
|
3 |
+
"height": 336,
|
4 |
+
"width": 336
|
5 |
+
},
|
6 |
+
"do_center_crop": true,
|
7 |
+
"do_convert_rgb": true,
|
8 |
+
"do_normalize": true,
|
9 |
+
"do_rescale": true,
|
10 |
+
"do_resize": true,
|
11 |
+
"image_mean": [
|
12 |
+
0.48145466,
|
13 |
+
0.4578275,
|
14 |
+
0.40821073
|
15 |
+
],
|
16 |
+
"image_processor_type": "CLIPImageProcessor",
|
17 |
+
"image_std": [
|
18 |
+
0.26862954,
|
19 |
+
0.26130258,
|
20 |
+
0.27577711
|
21 |
+
],
|
22 |
+
"processor_class": "LlavaProcessor",
|
23 |
+
"resample": 3,
|
24 |
+
"rescale_factor": 0.00392156862745098,
|
25 |
+
"size": {
|
26 |
+
"shortest_edge": 336
|
27 |
+
}
|
28 |
+
}
|
processor_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"image_token": "<image>",
|
3 |
+
"patch_size": 14,
|
4 |
+
"processor_class": "LlavaProcessor",
|
5 |
+
"vision_feature_select_strategy": "default"
|
6 |
+
}
|
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:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
3 |
+
size 499723
|
tokenizer_config.json
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
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": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
},
|
30 |
+
"32000": {
|
31 |
+
"content": "<image>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": true
|
37 |
+
},
|
38 |
+
"32001": {
|
39 |
+
"content": "<pad>",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": false,
|
42 |
+
"rstrip": false,
|
43 |
+
"single_word": false,
|
44 |
+
"special": true
|
45 |
+
}
|
46 |
+
},
|
47 |
+
"bos_token": "<s>",
|
48 |
+
"clean_up_tokenization_spaces": false,
|
49 |
+
"eos_token": "</s>",
|
50 |
+
"extra_special_tokens": {},
|
51 |
+
"legacy": false,
|
52 |
+
"model_max_length": 1000000000000000019884624838656,
|
53 |
+
"pad_token": "<pad>",
|
54 |
+
"padding_side": "left",
|
55 |
+
"processor_class": "LlavaProcessor",
|
56 |
+
"sp_model_kwargs": {},
|
57 |
+
"tokenizer_class": "LlamaTokenizer",
|
58 |
+
"trust_remote_code": false,
|
59 |
+
"unk_token": "<unk>",
|
60 |
+
"use_default_system_prompt": false
|
61 |
+
}
|