drishanarora commited on
Commit
132217a
·
verified ·
1 Parent(s): c43979c

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. README.md +253 -0
  3. chat_template.jinja +150 -0
  4. config.json +231 -0
  5. model-00001-of-00050.safetensors +3 -0
  6. model-00002-of-00050.safetensors +3 -0
  7. model-00004-of-00050.safetensors +3 -0
  8. model-00005-of-00050.safetensors +3 -0
  9. model-00007-of-00050.safetensors +3 -0
  10. model-00008-of-00050.safetensors +3 -0
  11. model-00009-of-00050.safetensors +3 -0
  12. model-00011-of-00050.safetensors +3 -0
  13. model-00012-of-00050.safetensors +3 -0
  14. model-00014-of-00050.safetensors +3 -0
  15. model-00015-of-00050.safetensors +3 -0
  16. model-00016-of-00050.safetensors +3 -0
  17. model-00017-of-00050.safetensors +3 -0
  18. model-00018-of-00050.safetensors +3 -0
  19. model-00019-of-00050.safetensors +3 -0
  20. model-00020-of-00050.safetensors +3 -0
  21. model-00022-of-00050.safetensors +3 -0
  22. model-00023-of-00050.safetensors +3 -0
  23. model-00024-of-00050.safetensors +3 -0
  24. model-00025-of-00050.safetensors +3 -0
  25. model-00026-of-00050.safetensors +3 -0
  26. model-00027-of-00050.safetensors +3 -0
  27. model-00030-of-00050.safetensors +3 -0
  28. model-00032-of-00050.safetensors +3 -0
  29. model-00033-of-00050.safetensors +3 -0
  30. model-00034-of-00050.safetensors +3 -0
  31. model-00035-of-00050.safetensors +3 -0
  32. model-00036-of-00050.safetensors +3 -0
  33. model-00037-of-00050.safetensors +3 -0
  34. model-00038-of-00050.safetensors +3 -0
  35. model-00039-of-00050.safetensors +3 -0
  36. model-00040-of-00050.safetensors +3 -0
  37. model-00041-of-00050.safetensors +3 -0
  38. model-00042-of-00050.safetensors +3 -0
  39. model-00043-of-00050.safetensors +3 -0
  40. model-00044-of-00050.safetensors +3 -0
  41. model-00045-of-00050.safetensors +3 -0
  42. model-00046-of-00050.safetensors +3 -0
  43. model-00047-of-00050.safetensors +3 -0
  44. model-00049-of-00050.safetensors +3 -0
  45. model-00050-of-00050.safetensors +3 -0
  46. model.safetensors.index.json +0 -0
  47. preprocessor_config.json +33 -0
  48. processor_config.json +6 -0
  49. special_tokens_map.json +23 -0
  50. tokenizer.json +3 -0
.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,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama4
3
+ library_name: transformers
4
+ base_model:
5
+ - meta-llama/Llama-4-Scout-17B-16E
6
+ ---
7
+
8
+ <p align="center">
9
+ <img src="images/deep-cogito-logo.png" alt="Logo" width="40%">
10
+ </p>
11
+
12
+
13
+ # Cogito v2 preview - 109B MoE
14
+
15
+ [Blog Post](https://www.deepcogito.com/research/cogito-v2-preview)
16
+
17
+ The Cogito v2 LLMs are instruction tuned generative models. All models are released under an open license for commercial use.
18
+
19
+ - Cogito v2 models are hybrid reasoning models. Each model can answer directly (standard LLM), or self-reflect before answering (like reasoning models).
20
+ - The LLMs are trained using **Iterated Distillation and Amplification (IDA)** - an scalable and efficient alignment strategy for superintelligence using iterative self-improvement.
21
+ - The models have been optimized for coding, STEM, instruction following and general helpfulness, and have significantly higher multilingual, coding and tool calling capabilities than size equivalent counterparts.
22
+ - In both standard and reasoning modes, Cogito v2-preview models outperform their size equivalent counterparts on common industry benchmarks.
23
+ - This model is trained in over 30 languages and supports long contexts (upto 10M tokens).
24
+
25
+ # Evaluations
26
+ For detailed evaluations, please refer to the [Blog Post](https://www.deepcogito.com/research/cogito-v2-preview).
27
+
28
+
29
+ # Usage
30
+ Here is a snippet below for usage with Transformers:
31
+
32
+ ```python
33
+ import transformers
34
+ import torch
35
+
36
+ model_id = "deepcogito/cogito-v2-preview-llama-109B-MoE"
37
+
38
+ pipeline = transformers.pipeline(
39
+ "text-generation",
40
+ model=model_id,
41
+ model_kwargs={"torch_dtype": torch.bfloat16},
42
+ device_map="auto",
43
+ )
44
+
45
+ messages = [
46
+ {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
47
+ {"role": "user", "content": "Give me a short introduction to LLMs."},
48
+ ]
49
+
50
+ outputs = pipeline(
51
+ messages,
52
+ max_new_tokens=512,
53
+ )
54
+
55
+ print(outputs[0]["generated_text"][-1])
56
+ ```
57
+
58
+
59
+
60
+ ## Implementing extended thinking
61
+ - By default, the model will answer in the standard mode.
62
+ - To enable thinking, you can do any one of the two methods:
63
+ - Set `enable_thinking=True` while applying the chat template.
64
+ - Add a specific system prompt, along with prefilling the response with "\<think\>\n".
65
+
66
+ **NOTE: Unlike Cogito v1 models, we initiate the response with "\<think\>\n" at the beginning of every output when reasoning is enabled. This is because hybrid models can be brittle at times (<0.1% of the cases), and adding a "\<think\>\n" ensures that the model does indeed respect thinking.**
67
+
68
+ ### Method 1 - Set enable_thinking=True in the tokenizer
69
+ If you are using Huggingface tokenizers, then you can simply use add the argument `enable_thinking=True` to the tokenization (this option is added to the chat template).
70
+
71
+ Here is an example -
72
+ ```python
73
+ from transformers import AutoModelForCausalLM, AutoTokenizer
74
+
75
+ model_name = "deepcogito/cogito-v2-preview-llama-109B-MoE"
76
+
77
+ model = AutoModelForCausalLM.from_pretrained(
78
+ model_name,
79
+ torch_dtype="auto",
80
+ device_map="auto"
81
+ )
82
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
83
+
84
+ prompt = "Give me a short introduction to LLMs."
85
+ messages = [
86
+ {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
87
+ {"role": "user", "content": prompt}
88
+ ]
89
+
90
+ text = tokenizer.apply_chat_template(
91
+ messages,
92
+ tokenize=False,
93
+ add_generation_prompt=True,
94
+ enable_thinking=True
95
+ )
96
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
97
+
98
+ generated_ids = model.generate(
99
+ **model_inputs,
100
+ max_new_tokens=512
101
+ )
102
+ generated_ids = [
103
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
104
+ ]
105
+
106
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
107
+ print(response)
108
+ ```
109
+
110
+ ### Method 2 - Add a specific system prompt, along with prefilling the response with "\<think\>\n".
111
+ To enable thinking using this method, you need to do two parts -
112
+
113
+
114
+ Step 1 - Simply use this in the system prompt `system_instruction = 'Enable deep thinking subroutine.'`
115
+
116
+ If you already have a system_instruction, then use `system_instruction = 'Enable deep thinking subroutine.' + '\n\n' + system_instruction`.
117
+
118
+ Step 2 - Prefil the response with the tokens `"<think>\n"`.
119
+
120
+ Here is an example -
121
+
122
+ ```python
123
+ import transformers
124
+ import torch
125
+
126
+ model_name = "deepcogito/cogito-v2-preview-llama-109B-MoE"
127
+
128
+ model = AutoModelForCausalLM.from_pretrained(
129
+ model_name,
130
+ torch_dtype="auto",
131
+ device_map="auto"
132
+ )
133
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
134
+
135
+ # Step 1 - Add deep thinking instruction.
136
+ DEEP_THINKING_INSTRUCTION = "Enable deep thinking subroutine."
137
+
138
+ messages = [
139
+ {"role": "system", "content": DEEP_THINKING_INSTRUCTION},
140
+ {"role": "user", "content": "Write a bash script that takes a matrix represented as a string with format '[1,2],[3,4],[5,6]' and prints the transpose in the same format."},
141
+ ]
142
+
143
+ text = tokenizer.apply_chat_template(
144
+ messages,
145
+ tokenize=False,
146
+ add_generation_prompt=True
147
+ )
148
+
149
+ # Step 2 - Prefill response with "<think>\n".
150
+ text += "<think>\n"
151
+
152
+ # Now, continue as usual.
153
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
154
+
155
+ generated_ids = model.generate(
156
+ **model_inputs,
157
+ max_new_tokens=512
158
+ )
159
+ generated_ids = [
160
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
161
+ ]
162
+
163
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
164
+ print(response)
165
+ ```
166
+
167
+
168
+ Similarly, if you have a system prompt, you can append the `DEEP_THINKING_INSTRUCTION` to the beginning in this way -
169
+
170
+ ```python
171
+ DEEP_THINKING_INSTRUCTION = "Enable deep thinking subroutine."
172
+
173
+ system_prompt = "Reply to each prompt with only the actual code - no explanations."
174
+ prompt = "Write a bash script that takes a matrix represented as a string with format '[1,2],[3,4],[5,6]' and prints the transpose in the same format."
175
+
176
+ messages = [
177
+ {"role": "system", "content": DEEP_THINKING_INSTRUCTION + '\n\n' + system_prompt},
178
+ {"role": "user", "content": prompt}
179
+ ]
180
+ ```
181
+
182
+
183
+ # Tool Calling
184
+ Cogito models support tool calling (single, parallel, multiple and parallel_multiple) both in standard and extended thinking mode.
185
+
186
+ Here is a snippet -
187
+
188
+ ```python
189
+ # First, define a tool
190
+ def get_current_temperature(location: str) -> float:
191
+ """
192
+ Get the current temperature at a location.
193
+
194
+ Args:
195
+ location: The location to get the temperature for, in the format "City, Country"
196
+ Returns:
197
+ The current temperature at the specified location in the specified units, as a float.
198
+ """
199
+ return 22. # A real function should probably actually get the temperature!
200
+
201
+ # Next, create a chat and apply the chat template
202
+ messages = [
203
+ {"role": "user", "content": "Hey, what's the temperature in Paris right now?"}
204
+ ]
205
+
206
+ model_inputs = tokenizer.apply_chat_template(messages, tools=[get_current_temperature], add_generation_prompt=True)
207
+
208
+ text = tokenizer.apply_chat_template(messages, tools=[get_current_temperature], add_generation_prompt=True, tokenize=False)
209
+ inputs = tokenizer(text, return_tensors="pt", add_special_tokens=False).to(model.device)
210
+ outputs = model.generate(**inputs, max_new_tokens=512)
211
+ output_text = tokenizer.batch_decode(outputs)[0][len(text):]
212
+ print(output_text)
213
+ ```
214
+
215
+ This will result in the output -
216
+ ```
217
+ <tool_call>
218
+ {"name": "get_current_temperature", "arguments": {"location": "Paris, France"}}
219
+ </tool_call><|eot|>
220
+ ```
221
+
222
+ You can then generate text from this input as normal. If the model generates a tool call, you should add it to the chat like so:
223
+
224
+ ```python
225
+ tool_call = {"name": "get_current_temperature", "arguments": {"location": "Paris, France"}}
226
+ messages.append({"role": "assistant", "tool_calls": [{"type": "function", "function": tool_call}]})
227
+ ```
228
+
229
+ and then call the tool and append the result, with the `tool` role, like so:
230
+
231
+ ```python
232
+ messages.append({"role": "tool", "name": "get_current_temperature", "content": "22.0"})
233
+ ```
234
+
235
+ After that, you can `generate()` again to let the model use the tool result in the chat:
236
+
237
+ ```python
238
+ text = tokenizer.apply_chat_template(messages, tools=[get_current_temperature], add_generation_prompt=True, tokenize=False)
239
+ inputs = tokenizer(text, return_tensors="pt", add_special_tokens=False).to(model.device)
240
+ outputs = model.generate(**inputs, max_new_tokens=512)
241
+ output_text = tokenizer.batch_decode(outputs)[0][len(text):]
242
+ ```
243
+
244
+ This should result in the string -
245
+ ```
246
+ 'The current temperature in Paris is 22.0 degrees.<|eot|>'
247
+ ```
248
+
249
+ ## License
250
+ This repository and the model weights are licensed under the [Llama 4 Community License Agreement](https://github.com/meta-llama/llama-models/blob/main/models/llama4/LICENSE) (Llama models' default license agreement).
251
+
252
+ ## Contact
253
+ If you would like to reach out to our team, send an email to [[email protected]]([email protected]).
chat_template.jinja ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {%- if not tools is defined %}
3
+ {%- set tools = none %}
4
+ {%- endif %}
5
+ {%- if not enable_thinking is defined %}
6
+ {%- set enable_thinking = false %}
7
+ {%- endif %}
8
+
9
+ {#- This block extracts the system message, so we can slot it into the right place. #}
10
+ {%- if messages[0]['role'] == 'system' %}
11
+ {%- if messages[0]['content'] is string %}
12
+ {%- set system_message = messages[0]['content']|trim %}
13
+ {%- else %}
14
+ {%- set system_message = messages[0]['content'][0]['text']|trim %}
15
+ {%- endif %}
16
+ {%- set messages = messages[1:] %}
17
+ {%- else %}
18
+ {%- set system_message = "" %}
19
+ {%- endif %}
20
+
21
+ {#- Set the system message. If enable_thinking is true, add the "Enable deep thinking subroutine." #}
22
+ {%- if enable_thinking %}
23
+ {%- if system_message != "" %}
24
+ {%- set system_message = "Enable deep thinking subroutine.
25
+
26
+ " ~ system_message %}
27
+ {%- else %}
28
+ {%- set system_message = "Enable deep thinking subroutine." %}
29
+ {%- endif %}
30
+ {%- endif %}
31
+
32
+ {#- System message + tools #}
33
+ {%- if tools is not none or system_message != '' %}
34
+ {{- "<|header_start|>system<|header_end|>
35
+
36
+ " }}
37
+ {{- system_message }}
38
+ {%- if tools is not none %}
39
+ {%- if system_message != "" %}
40
+ {{- "
41
+
42
+ " }}
43
+ {%- endif %}
44
+ {{- "Available Tools:
45
+ " }}
46
+ {%- for t in tools %}
47
+ {{- t | tojson(indent=4) }}
48
+ {{- "
49
+
50
+ " }}
51
+ {%- endfor %}
52
+ {%- endif %}
53
+ {{- "<|eot|>" }}
54
+ {%- endif %}
55
+
56
+ {#- Rest of the messages #}
57
+ {%- for message in messages %}
58
+ {#- Case 1 - Usual, non tool related message. #}
59
+ {%- if not (message.role == "ipython" or message.role == "tool" or message.role == "tool_results" or (message.tool_calls is defined and message.tool_calls is not none)) %}
60
+ {{- '<|header_start|>' + message['role'] + '<|header_end|>
61
+
62
+ ' }}
63
+ {%- if message['content'] is string %}
64
+ {{- message['content'] }}
65
+ {%- else %}
66
+ {%- for content in message['content'] %}
67
+ {%- if content['type'] == 'image' %}
68
+ {{- '<|image|>' }}
69
+ {%- elif content['type'] == 'text' %}
70
+ {{- content['text'] }}
71
+ {%- endif %}
72
+ {%- endfor %}
73
+ {%- endif %}
74
+ {{- "<|eot|>" }}
75
+
76
+ {#- Case 2 - the response is from the assistant, but has a tool call returned. #}
77
+ {%- elif message.tool_calls is defined and message.tool_calls is not none %}
78
+ {{- "<|header_start|>assistant<|header_end|>
79
+
80
+ " }}
81
+ {%- if message['content'] is string %}
82
+ {{- message['content'] }}
83
+ {%- if message['content'] | trim != "" %}
84
+ {{- "
85
+
86
+ " }}
87
+ {%- endif %}
88
+ {%- else %}
89
+ {%- for content in message['content'] %}
90
+ {%- if content['type'] == 'image' %}
91
+ {{- '<|image|>' }}
92
+ {%- elif content['type'] == 'text' %}
93
+ {{- content['text'] }}
94
+ {%- if content['text'] | trim != "" %}
95
+ {{- "
96
+
97
+ " }}
98
+ {%- endif %}
99
+ {%- endif %}
100
+ {%- endfor %}
101
+ {%- endif %}
102
+ {{- "[" }}
103
+ {%- for tool_call in message.tool_calls %}
104
+ {%- if tool_call.function is defined %}
105
+ {%- set out = tool_call.function|tojson %}
106
+ {%- if not tool_call.id is defined %}
107
+ {{- out }}
108
+ {%- else %}
109
+ {{- out[:-1] }}
110
+ {{- ', "id": "' + tool_call.id + '"}' }}
111
+ {%- endif %}
112
+ {%- else %}
113
+ {{- tool_call|tojson }}
114
+ {%- endif %}
115
+ {%- if not loop.last %}
116
+ {{- ", " }}
117
+ {%- else %}
118
+ {{- "]<|eot|>" }}
119
+ {%- endif %}
120
+ {%- endfor %}
121
+
122
+ {#- Case 3 - the response is from a tool call. #}
123
+ {%- elif message.role == "ipython" or message["role"] == "tool_results" or message["role"] == "tool" %}
124
+ {{- "<|header_start|>ipython<|header_end|>
125
+
126
+ " }}
127
+ {%- if message.tool_call_id is defined and message.tool_call_id != '' %}
128
+ {{- '{"content": ' }}
129
+ {%- if message.content is mapping or (message.content is iterable and not message.content is string) %}
130
+ {{- message.content | tojson }}
131
+ {%- else %}
132
+ {{- '"' ~ message.content ~ '"' }}
133
+ {%- endif %}
134
+ {{- ', "call_id": "' ~ message.tool_call_id ~ '"}' }}
135
+ {%- else %}
136
+ {%- if message.content is mapping or (message.content is iterable and not message.content is string) %}
137
+ {{- message.content | tojson }}
138
+ {%- else %}
139
+ {{- message.content }}
140
+ {%- endif %}
141
+ {%- endif %}
142
+ {{- "<|eot|>" }}
143
+ {%- endif %}
144
+ {%- endfor %}
145
+ {%- if add_generation_prompt %}
146
+ {{- '<|header_start|>assistant<|header_end|>\n\n' }}
147
+ {%- if enable_thinking %}
148
+ {{- '<think>\n' }}
149
+ {%- endif %}
150
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Llama4ForConditionalGeneration"
4
+ ],
5
+ "boi_token_index": 200080,
6
+ "eoi_token_index": 200081,
7
+ "image_token_index": 200092,
8
+ "model_type": "llama4",
9
+ "text_config": {
10
+ "attention_bias": false,
11
+ "attention_chunk_size": 8192,
12
+ "attention_dropout": 0.0,
13
+ "attn_scale": 0.1,
14
+ "attn_temperature_tuning": true,
15
+ "bos_token_id": 200000,
16
+ "eos_token_id": [
17
+ 200001,
18
+ 200007,
19
+ 200008
20
+ ],
21
+ "floor_scale": 8192,
22
+ "for_llm_compressor": false,
23
+ "head_dim": 128,
24
+ "hidden_act": "silu",
25
+ "hidden_size": 5120,
26
+ "initializer_range": 0.02,
27
+ "interleave_moe_layer_step": 1,
28
+ "intermediate_size": 8192,
29
+ "intermediate_size_mlp": 16384,
30
+ "layer_types": [
31
+ "chunked_attention",
32
+ "chunked_attention",
33
+ "chunked_attention",
34
+ "full_attention",
35
+ "chunked_attention",
36
+ "chunked_attention",
37
+ "chunked_attention",
38
+ "full_attention",
39
+ "chunked_attention",
40
+ "chunked_attention",
41
+ "chunked_attention",
42
+ "full_attention",
43
+ "chunked_attention",
44
+ "chunked_attention",
45
+ "chunked_attention",
46
+ "full_attention",
47
+ "chunked_attention",
48
+ "chunked_attention",
49
+ "chunked_attention",
50
+ "full_attention",
51
+ "chunked_attention",
52
+ "chunked_attention",
53
+ "chunked_attention",
54
+ "full_attention",
55
+ "chunked_attention",
56
+ "chunked_attention",
57
+ "chunked_attention",
58
+ "full_attention",
59
+ "chunked_attention",
60
+ "chunked_attention",
61
+ "chunked_attention",
62
+ "full_attention",
63
+ "chunked_attention",
64
+ "chunked_attention",
65
+ "chunked_attention",
66
+ "full_attention",
67
+ "chunked_attention",
68
+ "chunked_attention",
69
+ "chunked_attention",
70
+ "full_attention",
71
+ "chunked_attention",
72
+ "chunked_attention",
73
+ "chunked_attention",
74
+ "full_attention",
75
+ "chunked_attention",
76
+ "chunked_attention",
77
+ "chunked_attention",
78
+ "full_attention"
79
+ ],
80
+ "max_position_embeddings": 262144,
81
+ "model_type": "llama4_text",
82
+ "moe_layers": [
83
+ 0,
84
+ 1,
85
+ 2,
86
+ 3,
87
+ 4,
88
+ 5,
89
+ 6,
90
+ 7,
91
+ 8,
92
+ 9,
93
+ 10,
94
+ 11,
95
+ 12,
96
+ 13,
97
+ 14,
98
+ 15,
99
+ 16,
100
+ 17,
101
+ 18,
102
+ 19,
103
+ 20,
104
+ 21,
105
+ 22,
106
+ 23,
107
+ 24,
108
+ 25,
109
+ 26,
110
+ 27,
111
+ 28,
112
+ 29,
113
+ 30,
114
+ 31,
115
+ 32,
116
+ 33,
117
+ 34,
118
+ 35,
119
+ 36,
120
+ 37,
121
+ 38,
122
+ 39,
123
+ 40,
124
+ 41,
125
+ 42,
126
+ 43,
127
+ 44,
128
+ 45,
129
+ 46,
130
+ 47
131
+ ],
132
+ "no_rope_layers": [
133
+ 1,
134
+ 1,
135
+ 1,
136
+ 0,
137
+ 1,
138
+ 1,
139
+ 1,
140
+ 0,
141
+ 1,
142
+ 1,
143
+ 1,
144
+ 0,
145
+ 1,
146
+ 1,
147
+ 1,
148
+ 0,
149
+ 1,
150
+ 1,
151
+ 1,
152
+ 0,
153
+ 1,
154
+ 1,
155
+ 1,
156
+ 0,
157
+ 1,
158
+ 1,
159
+ 1,
160
+ 0,
161
+ 1,
162
+ 1,
163
+ 1,
164
+ 0,
165
+ 1,
166
+ 1,
167
+ 1,
168
+ 0,
169
+ 1,
170
+ 1,
171
+ 1,
172
+ 0,
173
+ 1,
174
+ 1,
175
+ 1,
176
+ 0,
177
+ 1,
178
+ 1,
179
+ 1,
180
+ 0
181
+ ],
182
+ "num_attention_heads": 40,
183
+ "num_experts_per_tok": 1,
184
+ "num_hidden_layers": 48,
185
+ "num_key_value_heads": 8,
186
+ "num_local_experts": 16,
187
+ "output_router_logits": false,
188
+ "pad_token_id": 200018,
189
+ "rms_norm_eps": 1e-05,
190
+ "rope_scaling": {
191
+ "factor": 16.0,
192
+ "high_freq_factor": 1.0,
193
+ "low_freq_factor": 1.0,
194
+ "original_max_position_embeddings": 8192,
195
+ "rope_type": "llama3"
196
+ },
197
+ "rope_theta": 500000.0,
198
+ "router_aux_loss_coef": 0.001,
199
+ "router_jitter_noise": 0.0,
200
+ "torch_dtype": "bfloat16",
201
+ "use_cache": true,
202
+ "use_qk_norm": true,
203
+ "vocab_size": 201135
204
+ },
205
+ "tie_word_embeddings": false,
206
+ "torch_dtype": "bfloat16",
207
+ "transformers_version": "4.53.0",
208
+ "vision_config": {
209
+ "attention_dropout": 0.0,
210
+ "hidden_act": "gelu",
211
+ "hidden_size": 1408,
212
+ "image_size": 336,
213
+ "initializer_range": 0.02,
214
+ "intermediate_size": 5632,
215
+ "model_type": "llama4_vision_model",
216
+ "multi_modal_projector_bias": false,
217
+ "norm_eps": 1e-05,
218
+ "num_attention_heads": 16,
219
+ "num_channels": 3,
220
+ "num_hidden_layers": 34,
221
+ "patch_size": 14,
222
+ "pixel_shuffle_ratio": 0.5,
223
+ "projector_dropout": 0.0,
224
+ "projector_input_dim": 4096,
225
+ "projector_output_dim": 4096,
226
+ "rope_theta": 10000,
227
+ "vision_feature_layer": -1,
228
+ "vision_feature_select_strategy": "default",
229
+ "vision_output_dim": 4096
230
+ }
231
+ }
model-00001-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83bdfc4963f0f68d7c8bf580bcce7e2ce867386b2576583f11c0f58684bb18f0
3
+ size 4119245064
model-00002-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2ddfe3dd685d9b609a515052dce9e9cc7d1fb543b522a5b4cf9f3736d367c91
3
+ size 4404205216
model-00004-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a2d67492d970dbcdb6c4cf44831f21c8ae7be4f46cb0aeea392564c5e3a0e05
3
+ size 4404205232
model-00005-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9eb00047f2103fe799e461aa04ab3201392fd9fd59854d57060d7d1dd676bf3
3
+ size 4404205232
model-00007-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c106f5b98b4dc53ece26a64d265faa2fd08a8b785ced496f829427e703745e25
3
+ size 4404205232
model-00008-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ddb3dfffb388a653dedad49371ff14ae06746189863f358643017b826901e66
3
+ size 4404205232
model-00009-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d50c84c1869a0caac85b60a83b782a88927be4ceabcf8c6b1c63cabcdf2bbc33
3
+ size 4404205232
model-00011-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d9b801f37d644c700de204181df62d137d1eee9b582774d5def9535a9c64b7f
3
+ size 4404205232
model-00012-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:760d1bb5b5815196d58783806c2d882092d081652f4e82ead49c0d45876e3997
3
+ size 4404205232
model-00014-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:996780ebe1559f9d1a80b6c83f201fe3ddf8e050d4d340783f64cf11a1fbdd8e
3
+ size 4404205216
model-00015-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54d06cb75a42f531c997cd9c4e7bc9184365c4c7528a85abf9a3311d46bc1b66
3
+ size 4404205232
model-00016-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2821ab1efa0c65226e91aabf6c22c86f5df704254174628024b731a079a7dbe7
3
+ size 4404205232
model-00017-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b936cef500a70f24625e22c270c515f2ba0d45207ea1ab2a3082eee5623f2b5
3
+ size 4404205232
model-00018-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd7b30a087c4225c28b471254244b1b3e4eb7d4d7e5985965f0f002c8394c852
3
+ size 4404205232
model-00019-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2883dbea4b45ae202f070cc3451e8bf3ca29e3276a8a114a3686aa5a486eec6e
3
+ size 4404205232
model-00020-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e315535074f3d658e333051a26bee6b13594f75a8e3af40c8dd28134fb976c8
3
+ size 4404205232
model-00022-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c938b92b21c0ad24fda4251edb7538fac50dbcae2e5a461bb39ce584ab02830f
3
+ size 4404205232
model-00023-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eeded936adb0da2448fa51de25b91ef10b30eb91d6faa3cddec71c688c982cd9
3
+ size 4404205232
model-00024-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:367514e793177b7c93c07e7f6956a5cb354c27013da0b1ba935d5763a992765f
3
+ size 4404205232
model-00025-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c9a9d0b72388787e1dd3abf19aabae3fcdde64381fa06ef46644a2bcfd39344
3
+ size 4404205216
model-00026-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2a80c8382fe0804729083cacd7a68bd2e1787ed3e9b9af50a6efde2ba8cfafa
3
+ size 4404205232
model-00027-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18a6e5255bbb5682b26c6aecf03d1a43774c806da9a13f645081505bda086394
3
+ size 4404205232
model-00030-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4900f411508266552ce10fa53fad536de2d5818fe01404494a96d595d83ca2e
3
+ size 4404205232
model-00032-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:230929fb23ee1abb87b0250a4413624756f17bb66eebe29cb651deb80d5fbbd8
3
+ size 4404205232
model-00033-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93a04301c90ff419cd453a866a72c11bf062b6931bcab1090db0a5f6159d8a15
3
+ size 4404205232
model-00034-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9edd1165e5b8edbb9c45e5eee66e2e97688488be9755e9ee0c1d52b476b48054
3
+ size 4404205232
model-00035-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d5c3188c3e324d69410eff7f4462b3fe0c69e4923526b5edf69302b69d18921
3
+ size 4404205232
model-00036-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d1b372f64dc1ba73a3f7251f96c3f4056f67b5faaf8e0dc1902d0ed3531f8a7
3
+ size 4404205216
model-00037-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f62fd355b56ee5fae84e2ca08af103d756e99efaad182a1cd547263c28d4559
3
+ size 4404205232
model-00038-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc69c3240a4da927f1c0d770e5285fbd4ba2f281c82dcd97f6c1567dcd04c8b6
3
+ size 4404205232
model-00039-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f04f00917e0669b6adac047fa67de9195f49b67bf6e327714988addf1a601b36
3
+ size 4404205232
model-00040-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a066fbf7c5d0d249b2bab91d0b58d2408ce92431639ecc80017e7300fb0e3652
3
+ size 4404205232
model-00041-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16a767873b893bcefed665ac474855099f37925151d9515777aef4a766580daa
3
+ size 4404205232
model-00042-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db519ea33c5f77826b4620b4807ad6c1af743964d075f542fc534897837ead29
3
+ size 4404205232
model-00043-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:613200397e4b51734e8dc508cd585ef00d3c907a44adbecd9421e19f81a8797a
3
+ size 4404205232
model-00044-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a1fc08e122807c6c19d0daa8a6125ad6a27d2f0f1c56fd1da0a16f24b777ffe
3
+ size 4404205232
model-00045-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3677a84dcd4f5edad50361deeb1e6d39c98c562f05346234d40b9b5d49466f91
3
+ size 4404205216
model-00046-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc701bf868ca04d2f97d80bc2976fd43840d4940930091af21ab9fc4bd060b1a
3
+ size 4404205216
model-00047-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccd5f7f029778833ca828bf68ea0e87ff0e35d98603252a4ba63e96d22d170c5
3
+ size 4404205216
model-00049-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a47fc2b1bcd500b42cba1ef212ce78e210739fd34f33a87be574058498537d7
3
+ size 4985848592
model-00050-of-00050.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21e41a5c1b0008147fbf0378e631ab9fb44f5e97eb0c38247ee811535864fe69
3
+ size 1162300336
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,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": null,
3
+ "data_format": "channels_first",
4
+ "default_to_square": true,
5
+ "device": null,
6
+ "do_center_crop": null,
7
+ "do_convert_rgb": true,
8
+ "do_normalize": true,
9
+ "do_rescale": true,
10
+ "do_resize": true,
11
+ "image_mean": [
12
+ 0.5,
13
+ 0.5,
14
+ 0.5
15
+ ],
16
+ "image_processor_type": "Llama4ImageProcessorFast",
17
+ "image_std": [
18
+ 0.5,
19
+ 0.5,
20
+ 0.5
21
+ ],
22
+ "input_data_format": null,
23
+ "max_patches": 16,
24
+ "processor_class": "Llama4Processor",
25
+ "resample": 2,
26
+ "rescale_factor": 0.00392156862745098,
27
+ "resize_to_max_canvas": false,
28
+ "return_tensors": null,
29
+ "size": {
30
+ "height": 336,
31
+ "width": 336
32
+ }
33
+ }
processor_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "fake_image_token": "<|image|>",
3
+ "image_token": "<|image|>",
4
+ "patch_size": 14,
5
+ "processor_class": "Llama4Processor"
6
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|begin_of_text|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|eot|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|finetune_right_pad|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:172c9eb4beafc72601690da3ccfcede5c2e6806a8d5ec1fca33e22acea8023a4
3
+ size 27948578