lewi commited on
Commit
9729a9e
·
verified ·
1 Parent(s): f240774

Upload folder using huggingface_hub

Browse files
.claude/settings.local.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(fd:*)",
5
+ "Bash(ls:*)",
6
+ "Bash(huggingface-cli upload:*)"
7
+ ]
8
+ }
9
+ }
README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - vision
5
+ - moondream
6
+ - mlx
7
+ - int8
8
+ - quantized
9
+ base_model: moondream/moondream3-preview
10
+ ---
11
+
12
+ # MD3P-Int8 - INT8 Quantized Moondream3 for MLX
13
+
14
+ An INT8 quantized version of Moondream3, offering a balance between model quality and size for MLX deployment.
15
+
16
+ ## Model Details
17
+
18
+ | Component | Original (BF16) | This Model |
19
+ |-----------|-----------------|------------|
20
+ | MoE Experts (layers 4-23) | BF16 | **int8** |
21
+ | Vision Encoder | BF16 | BF16 (preserved) |
22
+ | Text Attention | BF16 | **int8** |
23
+ | Text MLP (layers 0-3) | BF16 | **int8** |
24
+ | Embeddings | BF16 | BF16 (preserved) |
25
+ | **Total Size** | ~12 GB | **~10 GB** |
26
+
27
+ ## Quantization Details
28
+
29
+ - **Method**: Affine quantization (bits=8, group_size=64)
30
+ - **Target**: Text model layers (attention, MLP, MoE experts)
31
+ - **Preserved**: Vision encoder and embeddings at BF16 for quality
32
+
33
+ ## Comparison with INT4 Variants
34
+
35
+ | Model | Size | Quality | Use Case |
36
+ |-------|------|---------|----------|
37
+ | md3p-int8 (this) | 10 GB | Higher | Desktop/Server MLX |
38
+ | md3p-int4 | 6.48 GB | Medium | Memory-constrained |
39
+ | md3p-int4-smol | 5.43 GB | Lower | iOS (~6GB limit) |
40
+
41
+ ## Usage
42
+
43
+ This model is designed for use with MLX-based Moondream implementations.
44
+
45
+ ```python
46
+ # Example with mlx-lm or similar
47
+ from mlx_lm import load, generate
48
+
49
+ model, tokenizer = load("lewi/md3p-int8")
50
+ ```
51
+
52
+ ## Source & License
53
+
54
+ - **Original Model**: [moondream/moondream3-preview](https://huggingface.co/moondream/moondream3-preview)
55
+ - **License**: Apache 2.0 (same as original)
56
+
57
+ ## Acknowledgments
58
+
59
+ Thanks to the [Moondream](https://moondream.ai/) team for the original model and Apache 2.0 license.
config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "HfMoondream"
4
+ ],
5
+ "auto_map": {
6
+ "AutoConfig": "hf_moondream.HfConfig",
7
+ "AutoModelForCausalLM": "hf_moondream.HfMoondream"
8
+ },
9
+ "config": {
10
+ "skills": [
11
+ "query",
12
+ "caption",
13
+ "detect",
14
+ "point"
15
+ ]
16
+ },
17
+ "model_type": "moondream3",
18
+ "torch_dtype": "bfloat16",
19
+ "transformers_version": "4.51.1",
20
+ "text": {
21
+ "dim": 2048,
22
+ "ff_dim": 8192,
23
+ "n_layers": 24,
24
+ "vocab_size": 51200,
25
+ "max_context": 4096,
26
+ "n_heads": 32,
27
+ "n_kv_heads": 32,
28
+ "prefix_attn": 730,
29
+ "moe": {
30
+ "num_experts": 64,
31
+ "start_layer": 4,
32
+ "experts_per_token": 8,
33
+ "expert_inner_dim": 1024
34
+ },
35
+ "bits": 8,
36
+ "group_size": 64
37
+ },
38
+ "vision": {
39
+ "enc_dim": 1152,
40
+ "enc_patch_size": 14,
41
+ "enc_n_layers": 27,
42
+ "enc_ff_dim": 4304,
43
+ "enc_n_heads": 16,
44
+ "proj_out_dim": 2048,
45
+ "crop_size": 378,
46
+ "in_channels": 3,
47
+ "max_crops": 12,
48
+ "overlap_margin": 4,
49
+ "proj_inner_dim": 8192
50
+ },
51
+ "region": {
52
+ "dim": 2048,
53
+ "coord_feat_dim": 256,
54
+ "coord_out_dim": 1024,
55
+ "size_feat_dim": 512,
56
+ "size_out_dim": 2048,
57
+ "group_size": null
58
+ },
59
+ "dtype": "bfloat16"
60
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b17904a123e4ccbcb4e40dd731530aeaca7be45bc87f9d1dd545ccccd02430f7
3
+ size 10987576136
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<|endoftext|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<|md_reserved_0|>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "<|md_reserved_1|>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<|md_reserved_2|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "<|md_reserved_3|>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "5": {
44
+ "content": "<|md_reserved_4|>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "6": {
52
+ "content": "<|md_reserved_5|>",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ },
59
+ "7": {
60
+ "content": "<|md_reserved_6|>",
61
+ "lstrip": false,
62
+ "normalized": false,
63
+ "rstrip": false,
64
+ "single_word": false,
65
+ "special": true
66
+ },
67
+ "8": {
68
+ "content": "<|md_reserved_7|>",
69
+ "lstrip": false,
70
+ "normalized": false,
71
+ "rstrip": false,
72
+ "single_word": false,
73
+ "special": true
74
+ },
75
+ "9": {
76
+ "content": "<|md_reserved_8|>",
77
+ "lstrip": false,
78
+ "normalized": false,
79
+ "rstrip": false,
80
+ "single_word": false,
81
+ "special": true
82
+ },
83
+ "10": {
84
+ "content": "<|md_reserved_9|>",
85
+ "lstrip": false,
86
+ "normalized": false,
87
+ "rstrip": false,
88
+ "single_word": false,
89
+ "special": true
90
+ },
91
+ "11": {
92
+ "content": "<|md_reserved_10|>",
93
+ "lstrip": false,
94
+ "normalized": false,
95
+ "rstrip": false,
96
+ "single_word": false,
97
+ "special": true
98
+ },
99
+ "12": {
100
+ "content": "<|md_reserved_11|>",
101
+ "lstrip": false,
102
+ "normalized": false,
103
+ "rstrip": false,
104
+ "single_word": false,
105
+ "special": true
106
+ },
107
+ "13": {
108
+ "content": "<|md_reserved_12|>",
109
+ "lstrip": false,
110
+ "normalized": false,
111
+ "rstrip": false,
112
+ "single_word": false,
113
+ "special": true
114
+ },
115
+ "14": {
116
+ "content": "<|md_reserved_13|>",
117
+ "lstrip": false,
118
+ "normalized": false,
119
+ "rstrip": false,
120
+ "single_word": false,
121
+ "special": true
122
+ },
123
+ "15": {
124
+ "content": "<|md_reserved_14|>",
125
+ "lstrip": false,
126
+ "normalized": false,
127
+ "rstrip": false,
128
+ "single_word": false,
129
+ "special": true
130
+ },
131
+ "16": {
132
+ "content": "<|md_reserved_15|>",
133
+ "lstrip": false,
134
+ "normalized": false,
135
+ "rstrip": false,
136
+ "single_word": false,
137
+ "special": true
138
+ },
139
+ "17": {
140
+ "content": "<|md_reserved_16|>",
141
+ "lstrip": false,
142
+ "normalized": false,
143
+ "rstrip": false,
144
+ "single_word": false,
145
+ "special": true
146
+ },
147
+ "18": {
148
+ "content": "<|md_reserved_17|>",
149
+ "lstrip": false,
150
+ "normalized": false,
151
+ "rstrip": false,
152
+ "single_word": false,
153
+ "special": true
154
+ },
155
+ "19": {
156
+ "content": "<|md_reserved_18|>",
157
+ "lstrip": false,
158
+ "normalized": false,
159
+ "rstrip": false,
160
+ "single_word": false,
161
+ "special": true
162
+ },
163
+ "20": {
164
+ "content": "<|md_reserved_19|>",
165
+ "lstrip": false,
166
+ "normalized": false,
167
+ "rstrip": false,
168
+ "single_word": false,
169
+ "special": true
170
+ }
171
+ },
172
+ "clean_up_tokenization_spaces": false,
173
+ "extra_special_tokens": {},
174
+ "model_max_length": 1000000000000000019884624838656,
175
+ "tokenizer_class": "PreTrainedTokenizer"
176
+ }