NyxKrage commited on
Commit
2bd202d
·
verified ·
1 Parent(s): 772b05b

Upload folder using huggingface_hub

Browse files
LICENSE.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ | License | Business Source License (BSL 1.1) |
2
+ | --- | --- |
3
+ | Licensor | M87 Labs, Inc. |
4
+ | Licensed Work | “Moondream 3 (Preview)” including Model Weights and any Derivatives (“Derivatives” include fine-tunes, merges, quantizations, weight deltas, and other weight-level modifications or conversions.) |
5
+ | Additional Use Grant | You may make production use of the Licensed Work, provided Your use does not include offering the Licensed Work to third parties on a hosted or embedded basis in order to compete with M87 Labs’s paid version(s) of the Licensed Work. For purposes of this license:<br><br>A “competitive offering” is a Product that is offered to third parties on a paid basis, including through paid support arrangements, that significantly overlaps with the capabilities of M87 Labs’s paid version(s) of the Licensed Work. If Your Product is not a competitive offering when You first make it generally available, it will not become a competitive offering later due to M87 Labs releasing a new version of the Licensed Work with additional capabilities. In addition, Products that are not provided on a paid basis are not competitive.<br><br>“Product” means software that is offered to end users to manage in their own environments or offered as a service on a hosted basis.<br><br>“Embedded” means including the source code or executable code from the Licensed Work in a competitive offering. “Embedded” also means packaging the competitive offering in such a way that the Licensed Work must be accessed or downloaded for the competitive offering to operate.<br><br>Hosting or using the Licensed Work(s) for internal purposes within an organization is not considered a competitive offering. M87 Labs considers your organization to include all of your affiliates under common control. |
6
+ | Change Date | Two years after the first public release of this version of the Licensed Work |
7
+ | Change License | Apache License, Version 2.0 |
8
+
9
+ For information about alternative licensing arrangements for the Licensed Work, please contact [[email protected]](mailto:[email protected]).
10
+
11
+ The text of the Business Source License 1.1 follows. License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved. “Business Source License” is a trademark of MariaDB Corporation Ab.
12
+
13
+ ## Terms
14
+
15
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
16
+
17
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
18
+
19
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
20
+
21
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
22
+
23
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
24
+
25
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
26
+
27
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
chat_template.jinja ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {# Accepts:
2
+ - messages as a single string
3
+ - messages as 1-2 chat dicts: user[, assistant]
4
+ - user.content may be a string OR a list with exactly one {type:text} and one {type:image}
5
+ #}
6
+ {% if messages is string -%}
7
+ {% set text = messages | trim -%}
8
+ {% set has_assistant = false -%}
9
+ {%- else -%}
10
+ {% if messages | length < 1 or messages | length > 2 -%}
11
+ {{ raise_exception("Provide a single string or 1-2 messages (user[, assistant]).") }}
12
+ {%- endif -%}
13
+ {% if (messages[0].get('role') | default('')) != 'user' -%}
14
+ {{ raise_exception("First message must have role 'user'.") }}
15
+ {%- endif -%}
16
+ {% if messages | length == 2 and (messages[1].get('role') | default('')) != 'assistant' -%}
17
+ {{ raise_exception("Second message, if present, must have role 'assistant'.") }}
18
+ {%- endif -%}
19
+
20
+ {# Extract user text, supporting multimodal content #}
21
+ {% set ucontent = messages[0]['content'] | default('', true) -%}
22
+ {% if ucontent is string -%}
23
+ {% set text = ucontent | trim -%}
24
+ {%- else -%}
25
+ {% if ucontent | length != 2 -%}
26
+ {{ raise_exception("User content list must have exactly two parts: one text and one image.") }}
27
+ {%- endif -%}
28
+ {% set text_parts = ucontent | selectattr('type','equalto','text') | list -%}
29
+ {% set image_parts = ucontent | selectattr('type','equalto','image') | list -%}
30
+ {% if (text_parts | length) != 1 or (image_parts | length) != 1 -%}
31
+ {{ raise_exception("User content must include exactly one text and one image part.") }}
32
+ {%- endif -%}
33
+ {% set text = (text_parts[0].get('text') | default('')) | trim -%}
34
+ {%- endif -%}
35
+
36
+ {# Extract assistant text if present (string or list of parts) #}
37
+ {% set has_assistant = (messages | length == 2) -%}
38
+ {% if has_assistant -%}
39
+ {% set acontent = messages[1]['content'] | default('', true) -%}
40
+ {% if acontent is string -%}
41
+ {% set assistant_text = acontent -%}
42
+ {%- else -%}
43
+ {% set atexts = acontent | selectattr('type','equalto','text') | map(attribute='text') | list -%}
44
+ {% set assistant_text = (atexts | join('')) -%}
45
+ {%- endif -%}
46
+ {%- endif -%}
47
+ {%- endif -%}
48
+
49
+ {% set lower = text | lower -%}
50
+
51
+ {# Routing with zero-whitespace outputs #}
52
+ {% if text == '' -%}
53
+ <|md_reserved_0|>describe<|md_reserved_1|>normal<|md_reserved_2|>
54
+ {%- elif lower.startswith('caption:') -%}
55
+ {% set length = (text[8:] | trim | lower) -%}
56
+ {% if length not in ['short','normal','long'] -%}
57
+ {{ raise_exception("caption length must be one of: short, normal, long.") }}
58
+ {%- endif -%}
59
+ <|md_reserved_0|>describe<|md_reserved_1|>{{ length }}<|md_reserved_2|>
60
+ {%- elif lower.startswith('reason:') -%}
61
+ {% set q = text[7:] | trim -%}
62
+ <|md_reserved_0|>query<|md_reserved_1|>{{ q }}<|md_reserved_2|><|md_reserved_3|>
63
+ {%- elif lower.startswith('query:') -%}
64
+ {% set q = text[6:] | trim -%}
65
+ <|md_reserved_0|>query<|md_reserved_1|>{{ q }}<|md_reserved_2|>
66
+ {%- elif lower.startswith('detect:') -%}
67
+ {% set q = text[7:] | trim -%}
68
+ <|md_reserved_0|>det<|md_reserved_1|> {{ q }}<|md_reserved_2|>
69
+ {%- elif lower.startswith('point:') -%}
70
+ {% set q = text[6:] | trim -%}
71
+ <|md_reserved_0|>point<|md_reserved_1|> {{ q }}<|md_reserved_2|>
72
+ {%- else -%}
73
+ {% set q = text -%}
74
+ <|md_reserved_0|>query<|md_reserved_1|>{{ q }}<|md_reserved_2|>
75
+ {%- endif -%}
76
+ {%- generation -%}
77
+ {%- if has_assistant -%}{{ assistant_text }}{{ eos_token }}{%- endif -%}
78
+ {%- endgeneration -%}
config.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "moondream3",
3
+ "region_config": {
4
+ "coord_feat_dim": 256,
5
+ "coord_out_dim": 1024,
6
+ "hidden_size": 2048,
7
+ "model_type": "moondream3_region",
8
+ "size_feat_dim": 512,
9
+ "size_out_dim": 2048
10
+ },
11
+ "text_config": {
12
+ "attention_bias": true,
13
+ "attention_dropout": 0.0,
14
+ "bos_token_id": 0,
15
+ "eos_token_id": 0,
16
+ "coord_token_id": 5,
17
+ "head_dim": 64,
18
+ "hidden_act": "gelu_pytorch_tanh",
19
+ "hidden_size": 2048,
20
+ "initializer_range": 0.02,
21
+ "intermediate_size": 8192,
22
+ "max_position_embeddings": 4096,
23
+ "model_type": "moondream3_text",
24
+ "moe_hidden_act": "gelu",
25
+ "moe_intermediate_size": 1024,
26
+ "moe_start_layer": 4,
27
+ "num_attention_heads": 32,
28
+ "num_experts": 64,
29
+ "num_experts_per_tok": 8,
30
+ "num_hidden_layers": 24,
31
+ "num_key_value_heads": 32,
32
+ "output_router_logits": false,
33
+ "rms_norm_eps": 1e-05,
34
+ "rope_parameters": {
35
+ "rope_theta": 1500000.0,
36
+ "rope_type": "default"
37
+ },
38
+ "use_cache": false,
39
+ "vocab_size": 51200
40
+ },
41
+ "tie_word_embeddings": false,
42
+ "transformers_version": "5.0.0.dev0",
43
+ "vision_config": {
44
+ "attention_bias": true,
45
+ "attention_dropout": 0.0,
46
+ "crop_size": 378,
47
+ "hidden_act": "gelu_pytorch_tanh",
48
+ "hidden_size": 1152,
49
+ "in_channels": 3,
50
+ "initializer_range": 0.02,
51
+ "intermediate_size": 4304,
52
+ "max_crops": 12,
53
+ "model_type": "moondream3_vision",
54
+ "num_attention_heads": 16,
55
+ "num_hidden_layers": 27,
56
+ "overlap_margin": 4,
57
+ "patch_size": 14,
58
+ "prefix_len": 730,
59
+ "proj_inner_dim": 8192,
60
+ "proj_out_dim": 2048
61
+ }
62
+ }
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "cache_implementation": "dynamic",
4
+ "bos_token_id": 0,
5
+ "eos_token_id": 0,
6
+ "transformers_version": "5.0.0.dev0",
7
+ "use_cache": true
8
+ }
9
+
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1b992dcf85d87a027b8af4317ceb860768cba70f921d8ab60a2de2d49d8ccf3
3
+ size 18537874416
preprocessor_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor_type": "Moondream3ImageProcessor",
3
+ "max_crops": 12,
4
+ "overlap_margin": 4,
5
+ "processor_class": "Moondream3Processor"
6
+ }
processor_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "image_processor_type": "Moondream3ImageProcessor",
4
+ "max_crops": 12,
5
+ "overlap_margin": 4,
6
+ "processor_class": "Moondream3Processor"
7
+ },
8
+ "processor_class": "Moondream3Processor"
9
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|endoftext|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|endoftext|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
24
+
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "bos_token_id": 0,
175
+ "eos_token_id": 0,
176
+ "pad_token_id": 0,
177
+ "model_max_length": 1000000000000000019884624838656,
178
+ "processor_class": "Moondream3Processor",
179
+ "tokenizer_class": "PreTrainedTokenizerFast"
180
+ }