nervouslyopen commited on
Commit
dae5432
·
verified ·
1 Parent(s): 2a719f2

Upload folder using huggingface_hub

Browse files
.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,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license_name: qwen-research
3
+ license_link: https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct/blob/main/LICENSE
4
+ language:
5
+ - en
6
+ pipeline_tag: image-text-to-text
7
+ tags:
8
+ - multimodal
9
+ - mlx
10
+ library_name: mlx
11
+ base_model: Qwen/Qwen2.5-VL-3B-Instruct
12
+ ---
13
+
14
+ # nervouslyopen/Qwen2.5-VL-3B-Instruct-4bit
15
+
16
+ This model was converted to MLX format from [`Qwen/Qwen2.5-VL-3B-Instruct`](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct)
17
+ using mlx-vlm version **0.6.3**.
18
+ Refer to the [original model card](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct) for more details on the model.
19
+
20
+ ## Use with mlx
21
+
22
+ ```bash
23
+ pip install -U mlx-vlm
24
+ ```
25
+
26
+ ```bash
27
+ python -m mlx_vlm.generate --model nervouslyopen/Qwen2.5-VL-3B-Instruct-4bit --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>
28
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{% for message in messages %}{% if loop.first and message['role'] != 'system' %}<|im_start|>system
2
+ You are a helpful assistant.<|im_end|>
3
+ {% endif %}<|im_start|>{{ message['role'] }}
4
+ {% if message['content'] is string %}{{ message['content'] }}<|im_end|>
5
+ {% else %}{% for content in message['content'] %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|vision_start|><|image_pad|><|vision_end|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|vision_start|><|video_pad|><|vision_end|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}<|im_end|>
6
+ {% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant
7
+ {% endif %}
chat_template.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "chat_template": "{% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{% for message in messages %}{% if loop.first and message['role'] != 'system' %}<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n{% endif %}<|im_start|>{{ message['role'] }}\n{% if message['content'] is string %}{{ message['content'] }}<|im_end|>\n{% else %}{% for content in message['content'] %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|vision_start|><|image_pad|><|vision_end|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|vision_start|><|video_pad|><|vision_end|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}<|im_end|>\n{% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant\n{% endif %}"
3
+ }
config.json ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2_5_VLForConditionalGeneration"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "do_sample": true,
8
+ "eos_token_id": [
9
+ 151645,
10
+ 151643
11
+ ],
12
+ "generation_config": {
13
+ "bos_token_id": 151643,
14
+ "pad_token_id": 151643,
15
+ "do_sample": true,
16
+ "eos_token_id": [
17
+ 151645,
18
+ 151643
19
+ ],
20
+ "repetition_penalty": 1.05,
21
+ "temperature": 1e-06,
22
+ "transformers_version": "4.49.0"
23
+ },
24
+ "hidden_act": "silu",
25
+ "hidden_size": 2048,
26
+ "image_token_id": 151655,
27
+ "initializer_range": 0.02,
28
+ "intermediate_size": 11008,
29
+ "max_position_embeddings": 128000,
30
+ "max_window_layers": 70,
31
+ "model_type": "qwen2_5_vl",
32
+ "num_attention_heads": 16,
33
+ "num_hidden_layers": 36,
34
+ "num_key_value_heads": 2,
35
+ "quantization": {
36
+ "group_size": 64,
37
+ "bits": 4,
38
+ "mode": "affine"
39
+ },
40
+ "quantization_config": {
41
+ "group_size": 64,
42
+ "bits": 4,
43
+ "mode": "affine"
44
+ },
45
+ "rms_norm_eps": 1e-06,
46
+ "rope_scaling": {
47
+ "type": "mrope",
48
+ "mrope_section": [
49
+ 16,
50
+ 24,
51
+ 24
52
+ ]
53
+ },
54
+ "rope_theta": 1000000.0,
55
+ "sliding_window": 32768,
56
+ "temperature": 1e-06,
57
+ "tie_word_embeddings": true,
58
+ "transformers_version": "4.41.2",
59
+ "use_cache": true,
60
+ "use_sliding_window": false,
61
+ "video_token_id": 151656,
62
+ "vision_config": {
63
+ "depth": 32,
64
+ "hidden_act": "silu",
65
+ "hidden_size": 1280,
66
+ "intermediate_size": 3420,
67
+ "num_heads": 16,
68
+ "in_chans": 3,
69
+ "out_hidden_size": 2048,
70
+ "patch_size": 14,
71
+ "spatial_merge_size": 2,
72
+ "spatial_patch_size": 14,
73
+ "window_size": 112,
74
+ "fullatt_block_indexes": [
75
+ 7,
76
+ 15,
77
+ 23,
78
+ 31
79
+ ],
80
+ "tokens_per_second": 2,
81
+ "temporal_patch_size": 2
82
+ },
83
+ "vision_end_token_id": 151653,
84
+ "vision_start_token_id": 151652,
85
+ "vision_token_id": 151654,
86
+ "vocab_size": 151936
87
+ }
generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "pad_token_id": 151643,
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 151645,
7
+ 151643
8
+ ],
9
+ "repetition_penalty": 1.05,
10
+ "temperature": 0.000001,
11
+ "transformers_version": "4.49.0"
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6c75f366b0c54a328b8d64a5458a863cb6102646c8d885015c010f7e4d3ad4c
3
+ size 3073721056
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,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "min_pixels": 3136,
3
+ "max_pixels": 12845056,
4
+ "patch_size": 14,
5
+ "temporal_patch_size": 2,
6
+ "merge_size": 2,
7
+ "image_mean": [
8
+ 0.48145466,
9
+ 0.4578275,
10
+ 0.40821073
11
+ ],
12
+ "image_std": [
13
+ 0.26862954,
14
+ 0.26130258,
15
+ 0.27577711
16
+ ],
17
+ "image_processor_type": "Qwen2VLImageProcessor",
18
+ "processor_class": "Qwen2_5_VLProcessor"
19
+ }
processor_config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "do_convert_rgb": true,
4
+ "do_normalize": true,
5
+ "do_rescale": true,
6
+ "image_mean": [
7
+ 0.48145466,
8
+ 0.4578275,
9
+ 0.40821073
10
+ ],
11
+ "image_processor_type": "Qwen3VLImageProcessor",
12
+ "image_std": [
13
+ 0.26862954,
14
+ 0.26130258,
15
+ 0.27577711
16
+ ],
17
+ "max_pixels": 12845056,
18
+ "merge_size": 2,
19
+ "min_pixels": 3136,
20
+ "patch_size": 14,
21
+ "rescale_factor": 0.00392156862745098,
22
+ "temporal_patch_size": 2
23
+ },
24
+ "processor_class": "Qwen2_5_VLProcessor",
25
+ "video_processor": {
26
+ "do_convert_rgb": true,
27
+ "do_normalize": true,
28
+ "do_rescale": true,
29
+ "fps": 2.0,
30
+ "image_mean": [
31
+ 0.48145466,
32
+ 0.4578275,
33
+ 0.40821073
34
+ ],
35
+ "image_std": [
36
+ 0.26862954,
37
+ 0.26130258,
38
+ 0.27577711
39
+ ],
40
+ "max_frames": 768,
41
+ "max_pixels": 12845056,
42
+ "merge_size": 2,
43
+ "min_frames": 4,
44
+ "min_pixels": 3136,
45
+ "patch_size": 14,
46
+ "rescale_factor": 0.00392156862745098,
47
+ "temporal_patch_size": 2,
48
+ "video_processor_type": "Qwen3VLVideoProcessor"
49
+ }
50
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3fd169731d2cbde95e10bf356d66d5997fd885dd8dbb6fb4684da3f23b2585d8
3
+ size 11421892
tokenizer_config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>"
22
+ ],
23
+ "is_local": true,
24
+ "local_files_only": false,
25
+ "model_max_length": 131072,
26
+ "pad_token": "<|endoftext|>",
27
+ "processor_class": "Qwen2_5_VLProcessor",
28
+ "split_special_tokens": false,
29
+ "tokenizer_class": "Qwen2Tokenizer",
30
+ "unk_token": null
31
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff