findcard12138 commited on
Commit
923a2ee
·
verified ·
1 Parent(s): f8a8a80

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 CHANGED
@@ -1,3 +1,51 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MOSS-Video-Preview-Realtime-SFT 🤗
2
+
3
+ MOSS-Video-Preview-Realtime-SFT is a specialized model derived from MOSS-Video-Preview-SFT through an additional **Stage 4: Real-time Streaming Supervised Fine-Tuning (Real-time SFT)**. This model is deeply optimized for **low-latency, high-frequency real-time video stream understanding**, making it the most responsive version in the MOSS-Video-Preview series.
4
+
5
+ ## 🚀 Training Stages
6
+
7
+ The training process for this model involved four critical stages, achieving a breakthrough in real-time performance:
8
+
9
+ ### 1. Stage 1: Vision-Language Alignment (PT1)
10
+ - **Objective**: Establish initial alignment between visual features and the language model.
11
+ - **Configuration**: Trained only the Vision Projector; froze the Vision Tower and LLM.
12
+ - **Data**: Large-scale image-text pairs and short video clips.
13
+
14
+ ### 2. Stage 2: Full Spatio-Temporal Pretraining (PT2)
15
+ - **Objective**: Enhance the model's understanding of long videos and complex temporal relationships.
16
+ - **Configuration**: Full Parameter Fine-tuning; all modules (Vision Tower, Projector, and LLM) were unfrozen.
17
+ - **Data**: Supports long temporal video data with 256+ frames.
18
+
19
+ ### 3. Stage 3: Offline Supervised Fine-Tuning (Offline SFT)
20
+ - **Objective**: Equip the model with robust instruction-following and logical reasoning capabilities.
21
+ - **Configuration**: Full parameter fine-tuning, optimizing performance for complete video segments.
22
+ - **Data**: High-quality video instruction-following datasets (video Q&A, complex reasoning, etc.).
23
+
24
+ ### 4. Stage 4: Real-time Streaming SFT (Real-time SFT) 🌟
25
+ - **Objective**: **Core Stage**. Optimize the model's real-time response capability under continuous video stream input, significantly reducing Time to First Token (TTFT).
26
+ - **Configuration**:
27
+ - **Method**: Full parameter fine-tuning specifically for streaming inference mode.
28
+ - **Data**: Focused on real-time description, instant action feedback, and temporal grounding.
29
+ - **Optimization**: Improved temporal consistency under streaming input via gated positional embeddings in `MllamaVideoModel` and enhanced tile-based processing.
30
+
31
+ ## 🛠️ Key Technical Features
32
+
33
+ - **Native Real-time Streaming Architecture**: Supports frame-by-frame video input, enabling true "see-and-say" capabilities.
34
+ - **Ultra-fast Response (Low TTFT)**: ~5x faster TTFT compared to traditional video models, with an average first-token latency of less than 2 seconds.
35
+ - **High Throughput (High TPS)**: The optimized decoder achieves a generation speed of 38+ tokens/s on NVIDIA H200.
36
+ - **Unified Position Encoding**: Ensures perfect alignment between the visual stream and textual instructions in spatio-temporal dimensions.
37
+ - **Flash Attention 2**: Full support for FA2 acceleration, ensuring memory efficiency for long video stream processing.
38
+
39
+ ## 📥 Model Usage
40
+
41
+ The model can be loaded using the HuggingFace `transformers` library:
42
+
43
+ ```python
44
+ from transformers import AutoProcessor, AutoModelForCausalLM
45
+
46
+ checkpoint = "findcard12138/moss-video-realtime-sft"
47
+ processor = AutoProcessor.from_pretrained(checkpoint, trust_remote_code=True)
48
+ model = AutoModelForCausalLM.from_pretrained(checkpoint, trust_remote_code=True, device_map="auto")
49
+ ```
50
+
51
+ For detailed inference examples, please refer to `inference/infer_streaming.py` in the project root.
chat_template.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "chat_template": "{{- bos_token }}\n{%- if custom_tools is defined %}\n {%- set tools = custom_tools %}\n{%- endif %}\n{%- if not tools_in_user_message is defined %}\n {%- set tools_in_user_message = true %}\n{%- endif %}\n{%- if not date_string is defined %}\n {%- if strftime_now is defined %}\n {%- set date_string = strftime_now(\"%d %b %Y\") %}\n {%- else %}\n {%- set date_string = \"26 Jul 2024\" %}\n {%- endif %}\n{%- endif %}\n{%- if not tools is defined %}\n {%- set tools = none %}\n{%- endif %}\n\n{#- This block extracts the system message. #}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n {%- set user_supplied_system_message = true %}\n{%- else %}\n {%- set system_message = none %}\n {%- set user_supplied_system_message = false %}\n{%- endif %}\n\n{#- Find out if there are any images, not used here but kept for consistency #}\n{% set image_ns = namespace(has_images=false) %}\n{%- for message in messages %}\n {%- if message['content'] is iterable and message['content'] is not string %}\n {%- for content in message['content'] %}\n {%- if content['type'] == 'image' %}\n {%- set image_ns.has_images = true %}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n\n{#- System message printing logic: This block now ensures complete replacement. #}\n{{- \"<|start_header_id|>system<|end_header_id|>\\n\\n\" }}\n{%- if user_supplied_system_message %}\n {{- system_message }}\n{%- else %}\n {{- \"You are a helpful AI assistant. Respond to the user's request based on the provided text and/or images.\" }}\n{%- endif %}\n{{- \"<|eot_id|>\" }}\n\n{#- Custom tools are passed in a user message with some extra guidance #}\n{%- if tools_in_user_message and not tools is none %}\n {#- Extract the first user message so we can plug it in here #}\n {%- if messages | length != 0 %}\n {%- set first_user_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n {%- else %}\n {{- raise_exception(\"Cannot put tools in the first user message when there's no first user message!\") }}\n {%- endif %}\n {{- '<|start_header_id|>user<|end_header_id|>\\n\\n' -}}\n {{- \"Given the following functions, please respond with a JSON for a function call \" }}\n {{- \"with its proper arguments that best answers the given prompt.\\n\\n\" }}\n {{- 'Respond in the format {\\\"name\\\": function name, \\\"parameters\\\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n {{- first_user_message + \"<|eot_id|>\"}}\n{%- endif %}\n\n{%- for message in messages %}\n {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\\n\\n' }}\n {%- if message['content'] is string %}\n {{- message['content'] }}\n {%- else %}\n {%- for content in message['content'] %}\n {%- if content['type'] == 'image' %}\n {{- '<|image|>' }}\n {%- elif content['type'] == 'video' %}\n {{- '<|video|>' }}\n {%- elif content['type'] == 'text' %}\n {{- content['text'] }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|eot_id|>' }}\n {%- elif 'tool_calls' in message %}\n {%- if not message.tool_calls|length == 1 %}\n {{- raise_exception(\"This model only supports single tool-calls at once!\") }}\n {%- endif %}\n {%- set tool_call = message.tool_calls[0].function %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- '{\\\"name\\\": \\\"' + tool_call.name + '\\\", ' }}\n {{- '\\\"parameters\\\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- \"}\" }}\n {{- \"<|eot_id|>\" }}\n {%- elif message.role == \"tool\" or message.role == \"ipython\" %}\n {{- \"<|start_header_id|>ipython<|end_header_id|>\\n\\n\" }}\n {%- if message.content is mapping or message.content is iterable %}\n {{- message.content | tojson }}\n {%- else %}\n {{- message.content }}\n {%- endif %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' }}\n{%- endif %}\n"
3
+ }
4
+
config.json ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "VideoMllamaForConditionalGeneration"
4
+ ],
5
+ "image_token_index": 128256,
6
+ "model_type": "video_mllama",
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_video_mllama.VideoMllamaConfig",
9
+ "AutoModelForCausalLM": "modeling_video_mllama.VideoMllamaForConditionalGeneration",
10
+ "AutoModel": "modeling_video_mllama.VideoMllamaForConditionalGeneration"
11
+ },
12
+ "text_config": {
13
+ "_name_or_path": "",
14
+ "add_cross_attention": false,
15
+ "architectures": null,
16
+ "bad_words_ids": null,
17
+ "begin_suppress_tokens": null,
18
+ "bos_token_id": 128000,
19
+ "chunk_size_feed_forward": 0,
20
+ "cross_attention_hidden_size": null,
21
+ "cross_attention_layers": [
22
+ 3,
23
+ 8,
24
+ 13,
25
+ 18,
26
+ 23,
27
+ 28,
28
+ 33,
29
+ 38
30
+ ],
31
+ "decoder_start_token_id": null,
32
+ "diversity_penalty": 0.0,
33
+ "do_sample": false,
34
+ "dropout": 0,
35
+ "early_stopping": false,
36
+ "encoder_no_repeat_ngram_size": 0,
37
+ "eos_token_id": [
38
+ 128001,
39
+ 128008,
40
+ 128009
41
+ ],
42
+ "exponential_decay_length_penalty": null,
43
+ "finetuning_task": null,
44
+ "forced_bos_token_id": null,
45
+ "forced_eos_token_id": null,
46
+ "hidden_act": "silu",
47
+ "hidden_size": 4096,
48
+ "id2label": {
49
+ "0": "LABEL_0",
50
+ "1": "LABEL_1"
51
+ },
52
+ "initializer_range": 0.02,
53
+ "intermediate_size": 14336,
54
+ "is_decoder": false,
55
+ "is_encoder_decoder": false,
56
+ "label2id": {
57
+ "LABEL_0": 0,
58
+ "LABEL_1": 1
59
+ },
60
+ "length_penalty": 1.0,
61
+ "max_length": 20,
62
+ "max_position_embeddings": 131072,
63
+ "min_length": 0,
64
+ "model_type": "video_mllama_text_model",
65
+ "no_repeat_ngram_size": 0,
66
+ "num_attention_heads": 32,
67
+ "num_beam_groups": 1,
68
+ "num_beams": 1,
69
+ "num_hidden_layers": 40,
70
+ "num_key_value_heads": 8,
71
+ "num_return_sequences": 1,
72
+ "output_attentions": false,
73
+ "output_hidden_states": false,
74
+ "output_scores": false,
75
+ "pad_token_id": 128004,
76
+ "prefix": null,
77
+ "problem_type": null,
78
+ "pruned_heads": {},
79
+ "remove_invalid_values": false,
80
+ "repetition_penalty": 1.0,
81
+ "return_dict": true,
82
+ "return_dict_in_generate": false,
83
+ "rms_norm_eps": 1e-05,
84
+ "rope_scaling": {
85
+ "factor": 8.0,
86
+ "high_freq_factor": 4.0,
87
+ "low_freq_factor": 1.0,
88
+ "original_max_position_embeddings": 8192,
89
+ "rope_type": "llama3"
90
+ },
91
+ "rope_theta": 500000.0,
92
+ "sep_token_id": null,
93
+ "suppress_tokens": null,
94
+ "task_specific_params": null,
95
+ "temperature": 1.0,
96
+ "tf_legacy_loss": false,
97
+ "tie_encoder_decoder": false,
98
+ "tie_word_embeddings": false,
99
+ "tokenizer_class": null,
100
+ "top_k": 50,
101
+ "top_p": 1.0,
102
+ "torch_dtype": "bfloat16",
103
+ "torchscript": false,
104
+ "typical_p": 1.0,
105
+ "use_bfloat16": false,
106
+ "use_cache": true,
107
+ "vocab_size": 128256
108
+ },
109
+ "torch_dtype": "bfloat16",
110
+ "transformers_version": "4.47.1",
111
+ "vision_config": {
112
+ "_name_or_path": "",
113
+ "add_cross_attention": false,
114
+ "vision_ignore_attention_mask": true,
115
+ "merge_size": 4,
116
+ "merge_mode": "average",
117
+ "architectures": null,
118
+ "attention_heads": 16,
119
+ "bad_words_ids": null,
120
+ "begin_suppress_tokens": null,
121
+ "bos_token_id": null,
122
+ "chunk_size_feed_forward": 0,
123
+ "cross_attention_hidden_size": null,
124
+ "decoder_start_token_id": null,
125
+ "diversity_penalty": 0.0,
126
+ "do_sample": false,
127
+ "early_stopping": false,
128
+ "encoder_no_repeat_ngram_size": 0,
129
+ "eos_token_id": null,
130
+ "exponential_decay_length_penalty": null,
131
+ "finetuning_task": null,
132
+ "forced_bos_token_id": null,
133
+ "forced_eos_token_id": null,
134
+ "hidden_act": "gelu",
135
+ "hidden_size": 1280,
136
+ "id2label": {
137
+ "0": "LABEL_0",
138
+ "1": "LABEL_1"
139
+ },
140
+ "image_size": 560,
141
+ "intermediate_layers_indices": [
142
+ 3,
143
+ 7,
144
+ 15,
145
+ 23,
146
+ 30
147
+ ],
148
+ "intermediate_size": 5120,
149
+ "is_decoder": false,
150
+ "is_encoder_decoder": false,
151
+ "label2id": {
152
+ "LABEL_0": 0,
153
+ "LABEL_1": 1
154
+ },
155
+ "length_penalty": 1.0,
156
+ "max_length": 20,
157
+ "max_num_tiles": 4,
158
+ "min_length": 0,
159
+ "model_type": "video_mllama_vision_model",
160
+ "no_repeat_ngram_size": 0,
161
+ "norm_eps": 1e-05,
162
+ "num_beam_groups": 1,
163
+ "num_beams": 1,
164
+ "num_channels": 3,
165
+ "num_global_layers": 8,
166
+ "num_hidden_layers": 32,
167
+ "num_return_sequences": 1,
168
+ "output_attentions": false,
169
+ "output_hidden_states": false,
170
+ "output_scores": false,
171
+ "pad_token_id": null,
172
+ "patch_size": 14,
173
+ "prefix": null,
174
+ "problem_type": null,
175
+ "pruned_heads": {},
176
+ "remove_invalid_values": false,
177
+ "repetition_penalty": 1.0,
178
+ "return_dict": true,
179
+ "return_dict_in_generate": false,
180
+ "sep_token_id": null,
181
+ "supported_aspect_ratios": [
182
+ [
183
+ 1,
184
+ 1
185
+ ],
186
+ [
187
+ 1,
188
+ 2
189
+ ],
190
+ [
191
+ 1,
192
+ 3
193
+ ],
194
+ [
195
+ 1,
196
+ 4
197
+ ],
198
+ [
199
+ 2,
200
+ 1
201
+ ],
202
+ [
203
+ 2,
204
+ 2
205
+ ],
206
+ [
207
+ 3,
208
+ 1
209
+ ],
210
+ [
211
+ 4,
212
+ 1
213
+ ]
214
+ ],
215
+ "suppress_tokens": null,
216
+ "task_specific_params": null,
217
+ "temperature": 1.0,
218
+ "tf_legacy_loss": false,
219
+ "tie_encoder_decoder": false,
220
+ "tie_word_embeddings": true,
221
+ "tokenizer_class": null,
222
+ "top_k": 50,
223
+ "top_p": 1.0,
224
+ "torch_dtype": "bfloat16",
225
+ "torchscript": false,
226
+ "typical_p": 1.0,
227
+ "use_bfloat16": false,
228
+ "vision_output_dim": 7680
229
+ }
230
+ }
configuration_video_mllama.py ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2024 HuggingFace Inc. team. All rights reserved.
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """VideoMllama model configuration"""
15
+
16
+ from typing import Dict, List, Optional
17
+
18
+ from transformers.configuration_utils import PretrainedConfig
19
+ from transformers.modeling_rope_utils import rope_config_validation
20
+ from transformers.utils import logging
21
+
22
+
23
+ logger = logging.get_logger(__name__)
24
+
25
+
26
+ class VideoMllamaVisionConfig(PretrainedConfig):
27
+ r"""
28
+ This is the configuration class to store the configuration of a [`VideoMllamaVisionModel`]. It is used to instantiate an
29
+ VideoMllama vision model according to the specified arguments, defining the model architecture. Instantiating a configuration
30
+ with the defaults will yield a similar configuration to that of the VideoMllama-11B.
31
+
32
+ e.g. [meta-llama/Llama-3.2-11B-Vision](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision)
33
+
34
+ Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
35
+ documentation from [`PretrainedConfig`] for more information.
36
+
37
+ Args:
38
+ hidden_size (`int`, *optional*, defaults to 1280):
39
+ Dimensionality of the encoder layers and the pooler layer.
40
+ hidden_act (`str` or `function`, *optional*, defaults to `"gelu"`):
41
+ The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
42
+ `"relu"`, `"selu"` and `"gelu_new"` `"quick_gelu"` are supported.
43
+ num_hidden_layers (`int`, *optional*, defaults to 32):
44
+ Number of hidden layers in the Transformer encoder.
45
+ num_global_layers (`int`, *optional*, defaults to 8):
46
+ Number of global layers in the Transformer encoder.
47
+ Vision model has a second transformer encoder, called global.
48
+ num_attention_heads (`int`, *optional*, defaults to 16):
49
+ Number of attention heads for each attention layer in the Transformer encoder.
50
+ num_channels (`int`, *optional*, defaults to 3):
51
+ Number of channels in the input image.
52
+ intermediate_size (`int`, *optional*, defaults to 5120):
53
+ Dimensionality of the "intermediate" (often named feed-forward) layer in the Transformer encoder.
54
+ vision_output_dim (`int`, *optional*, defaults to 7680):
55
+ Dimensionality of the vision model output. Includes output of transformer
56
+ encoder with intermediate layers and global transformer encoder.
57
+ image_size (`int`, *optional*, defaults to 448):
58
+ The size (resolution) of each image *tile*.
59
+ patch_size (`int`, *optional*, defaults to 14):
60
+ The size (resolution) of each patch.
61
+ norm_eps (`float`, *optional*, defaults to 1e-05):
62
+ The epsilon used by the layer normalization layers.
63
+ max_num_tiles (`int`, *optional*, defaults to 4):
64
+ Maximum number of tiles for image splitting.
65
+ intermediate_layers_indices (`List[int]`, *optional*, defaults to [3, 7, 15, 23, 30]):
66
+ Indices of intermediate layers of transformer encoder from which to extract and output features.
67
+ These output features are concatenated with final hidden state of transformer encoder.
68
+ supported_aspect_ratios (`List[List[int]]`, *optional*):
69
+ List of supported aspect ratios for image splitting. If not specified, the default supported aspect ratios
70
+ are [[1, 1], [1, 2], [1, 3], [1, 4], [2, 1], [2, 2], [3, 1], [4, 1]] for `max_num_tiles=4`.
71
+ initializer_range (`float`, *optional*, defaults to 0.02):
72
+ The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
73
+
74
+ Example:
75
+
76
+ ```python
77
+ >>> from transformers import VideoMllamaVisionConfig, VideoMllamaVisionModel
78
+
79
+ >>> # Initializing a Llama config
80
+ >>> config = VideoMllamaVisionConfig()
81
+
82
+ >>> # Initializing a vision model from the VideoMllama-11b style configuration
83
+ >>> model = VideoMllamaVisionModel(config)
84
+
85
+ >>> # Accessing the model configuration
86
+ >>> configuration = model.config
87
+ ```"""
88
+
89
+ model_type = "video_mllama_vision_model"
90
+ base_config_key = "vision_config"
91
+
92
+ def __init__(
93
+ self,
94
+ hidden_size: int = 1280,
95
+ hidden_act: str = "gelu",
96
+ num_hidden_layers: int = 32,
97
+ num_global_layers: int = 8,
98
+ num_attention_heads: int = 16,
99
+ num_channels: int = 3,
100
+ intermediate_size: int = 5120,
101
+ vision_output_dim: int = 7680,
102
+ image_size: int = 448,
103
+ patch_size: int = 14,
104
+ norm_eps: float = 1e-5,
105
+ max_num_tiles: int = 4,
106
+ intermediate_layers_indices: Optional[List[int]] = None,
107
+ supported_aspect_ratios: Optional[List[List[int]]] = None,
108
+ initializer_range: float = 0.02,
109
+ vision_ignore_attention_mask: bool = True,
110
+ merge_size: int = 4,
111
+ merge_mode: str = "average",
112
+ **kwargs,
113
+ ):
114
+ if supported_aspect_ratios is None:
115
+ if max_num_tiles != 4:
116
+ raise ValueError("max_num_tiles must be 4 for default supported aspect ratios")
117
+ supported_aspect_ratios = [[1, 1], [1, 2], [1, 3], [1, 4], [2, 1], [2, 2], [3, 1], [4, 1]]
118
+
119
+ if intermediate_layers_indices is None:
120
+ intermediate_layers_indices = [3, 7, 15, 23, 30]
121
+
122
+ self.hidden_size = hidden_size
123
+ self.hidden_act = hidden_act
124
+ self.num_hidden_layers = num_hidden_layers
125
+ self.num_channels = num_channels
126
+ self.intermediate_size = intermediate_size
127
+ self.image_size = image_size
128
+ self.vision_output_dim = vision_output_dim
129
+ self.patch_size = patch_size
130
+ self.intermediate_layers_indices = intermediate_layers_indices
131
+ self.num_global_layers = num_global_layers
132
+ self.max_num_tiles = max_num_tiles
133
+ self.norm_eps = norm_eps
134
+ self.attention_heads = num_attention_heads
135
+ self.supported_aspect_ratios = supported_aspect_ratios
136
+ self.initializer_range = initializer_range
137
+ self.vision_ignore_attention_mask = vision_ignore_attention_mask
138
+ self.merge_size = merge_size
139
+ self.merge_mode = merge_mode
140
+
141
+
142
+ super().__init__(**kwargs)
143
+
144
+ @property
145
+ def max_aspect_ratio_id(self) -> int:
146
+ return len(self.supported_aspect_ratios)
147
+
148
+
149
+ class VideoMllamaTextConfig(PretrainedConfig):
150
+ r"""
151
+ This is the configuration class to store the configuration of a [`VideoMllamaTextModel`]. It is used to instantiate an
152
+ VideoMllama text model according to the specified arguments, defining the model architecture. Instantiating a configuration
153
+ with the defaults will yield a similar configuration to that of the VideoMllama-11B.
154
+
155
+ e.g. [meta-llama/Llama-3.2-11B-Vision](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision)
156
+
157
+ Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
158
+ documentation from [`PretrainedConfig`] for more information.
159
+
160
+ Args:
161
+ vocab_size (`int`, *optional*, defaults to 128256):
162
+ Vocabulary size of the VideoMllama text model. Defines the maximum number of different tokens that can be represented
163
+ by the `inputs_ids` passed when calling [`VideoMllamaTextModel`].
164
+ hidden_size (`int`, *optional*, defaults to 4096):
165
+ Dimensionality of the embeddings and hidden states.
166
+ hidden_act (`str` or `Callable`, *optional*, defaults to `"silu"`):
167
+ The non-linear activation function (function or string) in the encoder and pooler.
168
+ num_hidden_layers (`int`, *optional*, defaults to 40):
169
+ Number of hidden layers in the Transformer encoder.
170
+ num_attention_heads (`int`, *optional*, defaults to 32):
171
+ Number of attention heads for each attention layer in the Transformer encoder.
172
+ num_key_value_heads (`int`, *optional*, defaults to 8):
173
+ This is the number of key_value heads that should be used to implement Grouped Query Attention. If not
174
+ specified, will default to `num_attention_heads`.
175
+ intermediate_size (`int`, *optional*, defaults to 14336):
176
+ Dimensionality of the "intermediate" (often named feed-forward) layer in the Transformer encoder.
177
+ rope_theta (`float`, *optional*, defaults to `500000.0`):
178
+ The base period of the RoPE embeddings.
179
+ rope_scaling (`Dict`, *optional*):
180
+ Dictionary containing the scaling configuration for the RoPE embeddings. NOTE: if you apply new rope type
181
+ and you expect the model to work on longer `max_position_embeddings`, we recommend you to update this value
182
+ accordingly.
183
+ Expected contents:
184
+ `rope_type` (`str`):
185
+ The sub-variant of RoPE to use. Can be one of ['default', 'linear', 'dynamic', 'yarn', 'longrope',
186
+ 'llama3'], with 'default' being the original RoPE implementation.
187
+ `factor` (`float`, *optional*):
188
+ Used with all rope types except 'default'. The scaling factor to apply to the RoPE embeddings. In
189
+ most scaling types, a `factor` of x will enable the model to handle sequences of length x *
190
+ original maximum pre-trained length.
191
+ `original_max_position_embeddings` (`int`, *optional*):
192
+ Used with 'dynamic', 'longrope' and 'llama3'. The original max position embeddings used during
193
+ pretraining.
194
+ `attention_factor` (`float`, *optional*):
195
+ Used with 'yarn' and 'longrope'. The scaling factor to be applied on the attention
196
+ computation. If unspecified, it defaults to value recommended by the implementation, using the
197
+ `factor` field to infer the suggested value.
198
+ `beta_fast` (`float`, *optional*):
199
+ Only used with 'yarn'. Parameter to set the boundary for extrapolation (only) in the linear
200
+ ramp function. If unspecified, it defaults to 32.
201
+ `beta_slow` (`float`, *optional*):
202
+ Only used with 'yarn'. Parameter to set the boundary for interpolation (only) in the linear
203
+ ramp function. If unspecified, it defaults to 1.
204
+ `short_factor` (`List[float]`, *optional*):
205
+ Only used with 'longrope'. The scaling factor to be applied to short contexts (<
206
+ `original_max_position_embeddings`). Must be a list of numbers with the same length as the hidden
207
+ size divided by the number of attention heads divided by 2
208
+ `long_factor` (`List[float]`, *optional*):
209
+ Only used with 'longrope'. The scaling factor to be applied to long contexts (<
210
+ `original_max_position_embeddings`). Must be a list of numbers with the same length as the hidden
211
+ size divided by the number of attention heads divided by 2
212
+ `low_freq_factor` (`float`, *optional*):
213
+ Only used with 'llama3'. Scaling factor applied to low frequency components of the RoPE
214
+ `high_freq_factor` (`float`, *optional*):
215
+ Only used with 'llama3'. Scaling factor applied to high frequency components of the RoPE
216
+ rms_norm_eps (`float`, *optional*, defaults to 1e-05):
217
+ The epsilon used by the rms normalization layers.
218
+ max_position_embeddings (`int`, *optional*, defaults to 131072):
219
+ The maximum sequence length that this model might ever be used with.
220
+ initializer_range (`float`, *optional*, defaults to 0.02):
221
+ The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
222
+ use_cache (`bool`, *optional*, defaults to `True`):
223
+ Whether or not the model should return the last key/values attentions.
224
+ tie_word_embeddings (`bool`, *optional*, defaults to `False`):
225
+ Whether to tie weight embeddings
226
+ cross_attention_layers (`List[int]`, *optional*):
227
+ Indices of the cross attention layers. If not specified, will default to [3, 8, 13, 18, 23, 28, 33, 38].
228
+ dropout (`float`, *optional*, defaults to 0):
229
+ The dropout probability for self- and cross-attention layers.
230
+ bos_token_id (`int`, *optional*, defaults to 128000):
231
+ The id of the beginning of sentence token.
232
+ eos_token_id (`int`, *optional*, defaults to 128001):
233
+ The id of the end of sentence token.
234
+ pad_token_id (`int`, *optional*, defaults to 128004):
235
+ The id of the padding token.
236
+
237
+ Example:
238
+
239
+ ```python
240
+ >>> from transformers import VideoMllamaTextModel, VideoMllamaTextConfig
241
+
242
+ >>> # Initializing a VideoMllama text config
243
+ >>> config = VideoMllamaTextConfig()
244
+
245
+ >>> # Initializing a model from the VideoMllama text configuration
246
+ >>> model = VideoMllamaTextModel(config)
247
+
248
+ >>> # Accessing the model configuration
249
+ >>> configuration = model.config
250
+ ```"""
251
+
252
+ model_type = "video_mllama_text_model"
253
+ base_config_key = "text_config"
254
+
255
+ def __init__(
256
+ self,
257
+ vocab_size: int = 128256,
258
+ hidden_size: int = 4096,
259
+ hidden_act: str = "silu",
260
+ num_hidden_layers: int = 40,
261
+ num_attention_heads: int = 32,
262
+ num_key_value_heads: int = 8,
263
+ intermediate_size: int = 14_336,
264
+ rope_theta: float = 500_000,
265
+ rope_scaling: Optional[Dict] = None,
266
+ rms_norm_eps: float = 1e-5,
267
+ max_position_embeddings: int = 131_072,
268
+ initializer_range: float = 0.02,
269
+ use_cache: bool = True,
270
+ tie_word_embeddings: bool = False,
271
+ cross_attention_layers: Optional[List[int]] = None,
272
+ dropout: float = 0,
273
+ bos_token_id: int = 128000,
274
+ eos_token_id: int = 128001,
275
+ pad_token_id: Optional[int] = 128004,
276
+ **kwargs,
277
+ ):
278
+ if cross_attention_layers is None:
279
+ cross_attention_layers = [3, 8, 13, 18, 23, 28, 33, 38]
280
+
281
+ self.vocab_size = vocab_size
282
+ self.num_hidden_layers = num_hidden_layers
283
+ self.cross_attention_layers = cross_attention_layers
284
+ self.hidden_size = hidden_size
285
+ self.num_attention_heads = num_attention_heads
286
+ self.num_key_value_heads = num_key_value_heads
287
+ self.initializer_range = initializer_range
288
+ self.use_cache = use_cache
289
+ self.rope_theta = rope_theta
290
+ self.rms_norm_eps = rms_norm_eps
291
+ self.intermediate_size = intermediate_size
292
+ self.dropout = dropout
293
+ self.hidden_act = hidden_act
294
+ self.rope_scaling = rope_scaling
295
+ self.max_position_embeddings = max_position_embeddings
296
+ rope_config_validation(self)
297
+
298
+ super().__init__(
299
+ pad_token_id=pad_token_id,
300
+ bos_token_id=bos_token_id,
301
+ eos_token_id=eos_token_id,
302
+ tie_word_embeddings=tie_word_embeddings,
303
+ **kwargs,
304
+ )
305
+
306
+
307
+ class VideoMllamaConfig(PretrainedConfig):
308
+ r"""
309
+ This is the configuration class to store the configuration of a [`VideoMllamaForConditionalGeneration`]. It is used to instantiate an
310
+ VideoMllama model according to the specified arguments, defining the model architecture. Instantiating a configuration
311
+ with the defaults will yield a similar configuration to that of the VideoMllama-9B.
312
+
313
+ e.g. [meta-llama/Llama-3.2-11B-Vision](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision)
314
+
315
+ Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
316
+ documentation from [`PretrainedConfig`] for more information.
317
+
318
+ Args:
319
+ vision_config (`Union[AutoConfig, dict]`, *optional*, defaults to `VideoMllamaVisionConfig`):
320
+ The config object or dictionary of the vision backbone.
321
+ text_config (`Union[AutoConfig, dict]`, *optional*, defaults to `VideoMllamaTextConfig`):
322
+ The config object or dictionary of the text backbone.
323
+ image_token_index (`int`, *optional*, defaults to 128256):
324
+ The image token index to encode the image prompt.
325
+
326
+ Example:
327
+
328
+ ```python
329
+ >>> from transformers import VideoMllamaForConditionalGeneration, VideoMllamaConfig, VideoMllamaVisionConfig, VideoMllamaTextConfig
330
+
331
+ >>> # Initializing a CLIP-vision config
332
+ >>> vision_config = VideoMllamaVisionConfig()
333
+
334
+ >>> # Initializing a Llama config
335
+ >>> text_config = VideoMllamaTextConfig()
336
+
337
+ >>> # Initializing a VideoMllama-11b style configuration
338
+ >>> configuration = VideoMllamaConfig(vision_config, text_config)
339
+
340
+ >>> # Initializing a model from the VideoMllama-11b style configuration
341
+ >>> model = VideoMllamaForConditionalGeneration(configuration)
342
+
343
+ >>> # Accessing the model configuration
344
+ >>> configuration = model.config
345
+ ```"""
346
+
347
+ model_type = "video_mllama"
348
+ sub_configs = {"text_config": VideoMllamaTextConfig, "vision_config": VideoMllamaVisionConfig}
349
+
350
+ def __init__(
351
+ self,
352
+ vision_config=None,
353
+ text_config=None,
354
+ image_token_index=128256,
355
+ **kwargs,
356
+ ):
357
+ if vision_config is None:
358
+ self.vision_config = VideoMllamaVisionConfig()
359
+ logger.info("vision_config is None, using default VideoMllama vision config")
360
+ elif isinstance(vision_config, dict):
361
+ self.vision_config = VideoMllamaVisionConfig(**vision_config)
362
+ elif isinstance(vision_config, VideoMllamaVisionConfig):
363
+ self.vision_config = vision_config
364
+
365
+ self.image_token_index = image_token_index
366
+
367
+ if text_config is None:
368
+ self.text_config = VideoMllamaTextConfig()
369
+ logger.info("text_config is None, using default VideoMllama text config")
370
+ elif isinstance(text_config, dict):
371
+ self.text_config = VideoMllamaTextConfig(**text_config)
372
+ elif isinstance(text_config, VideoMllamaTextConfig):
373
+ self.text_config = text_config
374
+
375
+ super().__init__(**kwargs)
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 128000,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 128001,
6
+ 128008,
7
+ 128009
8
+ ],
9
+ "pad_token_id": 128004,
10
+ "temperature": 0.6,
11
+ "top_p": 0.9,
12
+ "transformers_version": "4.47.1"
13
+ }
image_processing_video_mllama.py ADDED
@@ -0,0 +1,930 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2024 The HuggingFace Inc. team.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import math
17
+ from functools import lru_cache
18
+ from typing import Dict, List, Optional, Tuple, Union
19
+
20
+ import numpy as np
21
+
22
+ from transformers.image_processing_utils import BaseImageProcessor, BatchFeature
23
+ from transformers.image_transforms import (
24
+ PaddingMode,
25
+ get_image_size,
26
+ pad,
27
+ resize,
28
+ )
29
+ from transformers.image_utils import (
30
+ IMAGENET_STANDARD_MEAN,
31
+ IMAGENET_STANDARD_STD,
32
+ ChannelDimension,
33
+ ImageInput,
34
+ PILImageResampling,
35
+ infer_channel_dimension_format,
36
+ is_valid_image,
37
+ is_vision_available,
38
+ to_numpy_array,
39
+ validate_preprocess_arguments,
40
+ )
41
+ from transformers.utils import TensorType, logging
42
+
43
+
44
+ if is_vision_available():
45
+ import PIL
46
+ from PIL import Image
47
+
48
+
49
+ logger = logging.get_logger(__name__)
50
+
51
+
52
+ @lru_cache(maxsize=10)
53
+ def get_all_supported_aspect_ratios(max_image_tiles: int) -> List[Tuple[int, int]]:
54
+ """
55
+ Computes all allowed aspect ratios for a given maximum number of input tiles.
56
+
57
+ This function calculates all possible arrangements of tiles that can be formed
58
+ within the constraint of the maximum number of tiles. Each arrangement is
59
+ represented by its aspect ratio (width/height) and the corresponding tile configuration.
60
+
61
+ Args:
62
+ max_image_tiles (`int`):
63
+ The maximum number of tiles allowed.
64
+
65
+ Returns:
66
+ `List[Tuple[int, int]]`: A list of tuples, each tuple representing a valid (width, height)
67
+ configuration in terms of number of tiles.
68
+
69
+ Example:
70
+ >>> get_all_supported_aspect_ratios(4)
71
+ [(1, 1), (1, 2), (1, 3), (1, 4), (2, 1), (2, 2), (3, 1), (4, 1)]
72
+
73
+ """
74
+ aspect_ratios = []
75
+ for width in range(1, max_image_tiles + 1):
76
+ for height in range(1, max_image_tiles + 1):
77
+ if width * height <= max_image_tiles:
78
+ aspect_ratios.append((width, height))
79
+ return aspect_ratios
80
+
81
+
82
+ def get_image_size_fit_to_canvas(
83
+ image_height: int,
84
+ image_width: int,
85
+ canvas_height: int,
86
+ canvas_width: int,
87
+ tile_size: int,
88
+ ) -> Tuple[int, int]:
89
+ """
90
+ Calculates the new size of an image to fit within a canvas while maintaining aspect ratio.
91
+
92
+ This function calculates the optimal size for an image to fit within a canvas defined by
93
+ canvas_height and canvas_width, while ensuring that the image dimensions are not smaller than
94
+ tile_size. If the image is larger than the canvas, the returned size will fit within the canvas.
95
+ If the image already fits within the canvas, the size remains unchanged.
96
+ The aspect ratio of the original image is preserved.
97
+
98
+ Args:
99
+ image_height (`int`):
100
+ The height of the original image.
101
+ image_width (`int`):
102
+ The width of the original image.
103
+ canvas_height (`int`):
104
+ The height of the canvas.
105
+ canvas_width (`int`):
106
+ The width of the canvas.
107
+ tile_size (`int`):
108
+ The tile size.
109
+
110
+ Returns:
111
+ `Tuple[int, int]`: A tuple containing the new height and width of the image.
112
+
113
+ """
114
+ # Set target image size in between `tile_size` and canvas_size
115
+ target_width = np.clip(image_width, tile_size, canvas_width)
116
+ target_height = np.clip(image_height, tile_size, canvas_height)
117
+
118
+ scale_h = target_height / image_height
119
+ scale_w = target_width / image_width
120
+
121
+ if scale_w < scale_h:
122
+ new_width = target_width
123
+ new_height = min(math.floor(image_height * scale_w), target_height)
124
+ else:
125
+ new_height = target_height
126
+ new_width = min(math.floor(image_width * scale_h), target_width)
127
+
128
+ return new_height, new_width
129
+
130
+
131
+ @lru_cache(maxsize=100)
132
+ def get_optimal_tiled_canvas(
133
+ image_height: int,
134
+ image_width: int,
135
+ max_image_tiles: int,
136
+ tile_size: int,
137
+ ) -> Tuple[int, int]:
138
+ r"""
139
+ Determines the best canvas based on image and tile size and maximum number of tiles.
140
+
141
+ First, calculates possible resolutions based on the maximum number of tiles and tile size.
142
+ For example for max_image_tiles=2, tile_size=100, possible tile arrangements are:
143
+ [(1, 1), (1, 2), (2, 1)] and corresponding canvas sizes are:
144
+ [(100, 100), (100, 200), (200, 100)]
145
+
146
+ For each possible resolution, calculates the scaling factors for
147
+ width and height, and selects the smallest one, which is the limiting side.
148
+ E.g. to match the canvas you can upscale height by 2x, and width by 1.5x,
149
+ therefore, the maximum upscaling you can do is min(2, 1.5) = 1.5.
150
+
151
+ If upscaling is possible (any of the scaling factors is greater than 1),
152
+ then picks the smallest upscaling factor > 1.
153
+
154
+ If upscaling is not possible, then picks the largest scaling factor <= 1, i.e.
155
+ reduce downscaling as much as possible.
156
+
157
+ If there are multiple resolutions with the same max scale, we pick the one with the lowest area,
158
+ to minimize padding. E.g., the same image can be upscaled to 224x224 and 224x448, but the latter
159
+ has more padding.
160
+
161
+ Example of canvases made from tiles:
162
+
163
+ To visualize how the image can fit onto different tile grids, let's try fitting an ASCII cat into the tiles.
164
+
165
+ Here's an ASCII cat image you want to fit into the tiles:
166
+
167
+ /\_/\
168
+ ( o.o )
169
+ > ^ <
170
+
171
+ If `num_tiles=6`, possible tile grids would look like this:
172
+
173
+ **2x3 Canvas (2 tiles wide, 3 tiles tall)**: -> total of 6 tiles
174
+ +-------+-------+
175
+ | /\_/\ | 0 | <- Cat image split across two tiles horizontally
176
+ +-------+-------+
177
+ | > ^ < | 0 | <- Remaining part of the cat occupies the left tile
178
+ +-------+-------+
179
+ |( o.o )| 0 |
180
+ +-------+-------+
181
+
182
+ **3x2 Canvas (3 tiles wide, 2 tiles tall)**: -> total of 6 tiles
183
+ +-------+-------+-------+
184
+ | /\_/\ |( o.o )| 0 | <- Cat image occupies the first two tiles, 1 tile remains empty
185
+ +-------+-------+-------+
186
+ | > ^ < | 0 | 0 | <- Remaining part of the cat occupies the left tile
187
+ +-------+-------+-------+
188
+
189
+ **1x6 Canvas (1 tile wide, 6 tiles tall)**: -> total of 6 tiles
190
+ +-------+
191
+ | /\_/\ | <- Top part of the cat
192
+ +-------+
193
+ |( o.o )| <- Middle part of the cat
194
+ +-------+
195
+ | > ^ < | <- Bottom part of the cat
196
+ +-------+
197
+ | 0 |
198
+ +-------+
199
+ | 0 |
200
+ +-------+
201
+ | 0 |
202
+ +-------+
203
+
204
+ Given that the tiles you get depend on the chosen aspect ratio, you have to add
205
+ embedding in the modeling code to help it know if it got a 3x2 or a 1x6 or a 2x3
206
+ aspect ratio.
207
+
208
+ The function tests these arrangements to find the smallest canvas where the image fits.
209
+ If multiple canvases fit, it selects the one where the dimensions are closest to the image size.
210
+
211
+ In this case the first canvas is the closest to the original image.
212
+
213
+ You then feed all of the tiles to the model:
214
+
215
+ +-------+-------+-------+-------+-------+-------+
216
+ - | /\_/\ |( o.o )| > ^ < | 0 | 0 | 0 | <- Last canvas
217
+ +-------+-------+-------+-------+-------+-------+
218
+
219
+ +-------+-------+-------+-------+-------+-------+
220
+ - | /\_/\ | 0 |( o.o )| 0 | > ^ < | 0 | <- First canvas
221
+ +-------+-------+-------+-------+-------+-------+
222
+
223
+ +-------+-------+-------+-------+-------+-------+
224
+ - | /\_/\ |( o.o )| 0 | > ^ < | 0 | 0 | <- second canvas
225
+ +-------+-------+-------+-------+-------+-------+
226
+
227
+ For each tile, you have num_channels (usually RGB so 3), tile_width, tile_height
228
+
229
+ Args:
230
+ image_height (`int`):
231
+ The height of the image.
232
+ image_width (`int`):
233
+ The width of the image.
234
+ max_image_tiles (`int`):
235
+ The maximum number of tiles any image can be split into.
236
+ tile_size (`int`):
237
+ The tile size.
238
+
239
+ Returns:
240
+ `Tuple[int, int]`: The best canvas resolution [height, width] for the given image.
241
+ """
242
+ possible_tile_arrangements = get_all_supported_aspect_ratios(max_image_tiles)
243
+ possible_canvas_sizes = np.array(possible_tile_arrangements) * tile_size
244
+
245
+ # get all possible resolutions heights/widths
246
+ target_heights, target_widths = np.array(possible_canvas_sizes).T
247
+
248
+ # get scaling factors to resize the image without distortion
249
+ scale_h = target_heights / image_height
250
+ scale_w = target_widths / image_width
251
+
252
+ # get the min scale between width and height (limiting side -> no distortion)
253
+ scales = np.where(scale_w > scale_h, scale_h, scale_w)
254
+
255
+ # filter only scales that allow upscaling
256
+ upscaling_options = scales[scales >= 1]
257
+ if len(upscaling_options) > 0:
258
+ selected_scale = np.min(upscaling_options)
259
+ else:
260
+ # no upscaling possible,
261
+ # get the minimum downscaling (max scale for scales<1)
262
+ downscaling_options = scales[scales < 1]
263
+ selected_scale = np.max(downscaling_options)
264
+
265
+ # get all resolutions that support this scaling factor,
266
+ # e.g. you can upscale to 224x224, 224x448, 224x672 without distortion
267
+ chosen_canvas = possible_canvas_sizes[scales == selected_scale]
268
+
269
+ # if there are multiple resolutions,
270
+ # get the one with minimum area to reduce padding
271
+ if len(chosen_canvas) > 1:
272
+ areas = chosen_canvas[:, 0] * chosen_canvas[:, 1]
273
+ optimal_idx = np.argmin(areas)
274
+ optimal_canvas = chosen_canvas[optimal_idx]
275
+ else:
276
+ optimal_canvas = chosen_canvas[0]
277
+
278
+ return optimal_canvas
279
+
280
+
281
+ def split_to_tiles(image: np.ndarray, num_tiles_height: int, num_tiles_width: int) -> np.ndarray:
282
+ """
283
+ Split an image into a specified number of tiles along its width and height dimensions.
284
+
285
+ Args:
286
+ image (`np.ndarray`):
287
+ Input image with shape (num_channels, height, width).
288
+ num_tiles_height (`int`):
289
+ Number of tiles to split the image into along its height.
290
+ num_tiles_width (`int`):
291
+ Number of tiles to split the image into along its width.
292
+
293
+ Returns:
294
+ `np.ndarray`:
295
+ Array of image tiles with shape (num_tiles_width * num_tiles_height, num_channels, tile_height, tile_width).
296
+ """
297
+ num_channels, height, width = image.shape
298
+ tile_height = height // num_tiles_height
299
+ tile_width = width // num_tiles_width
300
+
301
+ image = image.reshape(num_channels, num_tiles_height, tile_height, num_tiles_width, tile_width)
302
+
303
+ # Permute to (num_tiles_height, num_tiles_width, num_channels, tile_height, tile_width)
304
+ image = image.transpose(1, 3, 0, 2, 4)
305
+
306
+ # Reshape into the desired output shape (num_tiles_width * num_tiles_height, num_channels, tile_height, tile_width)
307
+ image = image.reshape(num_tiles_width * num_tiles_height, num_channels, tile_height, tile_width)
308
+
309
+ return np.ascontiguousarray(image)
310
+
311
+
312
+ def build_aspect_ratio_mask(aspect_ratios: List[List[Tuple[int, int]]], max_image_tiles: int) -> np.ndarray:
313
+ """
314
+ Builds a mask for the aspect ratios of the images.
315
+
316
+ Args:
317
+ aspect_ratios (`List[List[Tuple[int, int]]]`):
318
+ A list of lists containing aspect ratios for each image in the batch.
319
+ Each aspect ratio is represented as a tuple of (width, height) in terms of number of tiles.
320
+ max_image_tiles (`int`):
321
+ The maximum number of tiles any image can be split into.
322
+
323
+ Returns:
324
+ `np.ndarray`: A 3D numpy array of shape (batch_size, max_num_images, max_image_tiles).
325
+ The mask contains 1s for valid tiles and 0s for padding.
326
+ """
327
+ batch_size = len(aspect_ratios)
328
+ max_num_images = max([len(row) for row in aspect_ratios])
329
+
330
+ aspect_ratio_mask = np.zeros((batch_size, max_num_images, max_image_tiles), dtype=np.int64)
331
+
332
+ # Set the first tile to 1 for all aspect ratios
333
+ # because in original implementation aspect ratios are padded with (1, 1),
334
+ # but original code examples are not built to handle batches, so we might remove it later
335
+ aspect_ratio_mask[:, :, 0] = 1
336
+
337
+ # Set the aspect ratio mask for the rest of the tiles
338
+ for i, sample_aspect_ratios in enumerate(aspect_ratios):
339
+ for j, (num_tiles_w, num_tiles_h) in enumerate(sample_aspect_ratios):
340
+ aspect_ratio_mask[i, j, : num_tiles_w * num_tiles_h] = 1
341
+
342
+ return aspect_ratio_mask
343
+
344
+
345
+ def pack_images(
346
+ batch_images: List[List[np.ndarray]],
347
+ max_image_tiles: int,
348
+ ) -> Tuple[np.ndarray, List[List[int]]]:
349
+ """
350
+ Stack a list of lists of images with variable lengths into a numpy array, applying zero padding as needed.
351
+ Each list in the input represents a batch sample, and each image within a list is expected to be
352
+ pre-split into tiles. The resulting array will have a shape of
353
+ (batch_size, max_num_images, max_image_tiles, channels, tile_height, tile_width).
354
+
355
+ Args:
356
+ batch_images (`List[List[np.ndarray]]`):
357
+ A list of lists of image tiles. Each inner list represents
358
+ a batch sample containing multiple images, where each image is pre-split into tiles.
359
+ The shape of each tile array is (num_tiles, channels, tile_height, tile_width).
360
+ max_image_tiles (int):
361
+ The maximum number of tiles any image was potantially split.
362
+
363
+ Returns:
364
+ `Tuple[np.ndarray, List[List[int]]]`: A tuple containing:
365
+ - stacked_images (`np.ndarray`):
366
+ A numpy array of stacked images with shape
367
+ (batch_size, max_num_images, max_image_tiles, channels, tile_height, tile_width).
368
+ - all_num_tiles (`List[List[int]]`):
369
+ A list of lists containing the number of tiles
370
+ for each image in each batch sample.
371
+ """
372
+
373
+ # Determine output shape
374
+ batch_size = len(batch_images)
375
+ max_num_images = max([len(images) for images in batch_images])
376
+ shapes = [image.shape for images in batch_images for image in images]
377
+ _, channels, tile_height, tile_width = shapes[0]
378
+
379
+ # Initialize the stacked images array with zeros
380
+ stacked_images = np.zeros(
381
+ (batch_size, max_num_images, max_image_tiles, channels, tile_height, tile_width),
382
+ dtype=np.float32,
383
+ )
384
+
385
+ # Fill the stacked images array with the tiled images from the batch
386
+ all_num_tiles = []
387
+ for i, images in enumerate(batch_images):
388
+ num_sample_tiles = []
389
+ for j, image in enumerate(images):
390
+ num_tiles = image.shape[0]
391
+ stacked_images[i, j, :num_tiles] = image
392
+ num_sample_tiles.append(num_tiles)
393
+ all_num_tiles.append(num_sample_tiles)
394
+
395
+ return stacked_images, all_num_tiles
396
+
397
+
398
+ def pack_aspect_ratios(aspect_ratios: List[List[Tuple[int, int]]], pad_value: int = 1) -> np.ndarray:
399
+ """
400
+ Stack a list of aspect ratios into a numpy array.
401
+
402
+ Args:
403
+ aspect_ratios (`List[List[Tuple[int, int]]]`):
404
+ A list of aspect ratios.
405
+ pad_value (`int`, *optional*, defaults to 1):
406
+ The value to pad the aspect ratios with.
407
+
408
+ Returns:
409
+ `np.ndarray`:
410
+ The aspect ratios stacked into a numpy array with shape (batch_size, max_num_images, 2).
411
+ """
412
+ batch_size = len(aspect_ratios)
413
+ max_num_images = max([len(row) for row in aspect_ratios])
414
+
415
+ aspect_ratios_stacked = np.full((batch_size, max_num_images, 2), pad_value, dtype=np.int64)
416
+ for i, row in enumerate(aspect_ratios):
417
+ if len(row) > 0:
418
+ aspect_ratios_stacked[i, : len(row)] = np.array(row)
419
+ return aspect_ratios_stacked
420
+
421
+
422
+ def convert_aspect_ratios_to_ids(aspect_ratios: List[List[Tuple[int, int]]], max_image_tiles: int) -> np.ndarray:
423
+ """
424
+ Convert aspect ratio tuples to unique ids.
425
+
426
+ For batch padding we use 0, because there might be different number of images in each batch.
427
+ The aspect ratio ids start from 1, with 1 corresponding to the first supported aspect ratio.
428
+
429
+ Args:
430
+ aspect_ratios (`List[List[Tuple[int, int]]]`):
431
+ A list of aspect ratios for each image in the batch.
432
+ max_image_tiles (`int`):
433
+ The maximum number of tiles any image can be split into.
434
+
435
+ Returns:
436
+ `np.ndarray`:
437
+ The aspect ratios ids as a numpy array with shape (batch_size, max_num_images).
438
+ Each id corresponds to the index of the aspect ratio in the list of supported aspect ratios,
439
+ offset by 1 (so 0 can be used for padding).
440
+ """
441
+
442
+ batch_size = len(aspect_ratios)
443
+ max_num_images = max([len(row) for row in aspect_ratios])
444
+ supported_aspect_ratios = get_all_supported_aspect_ratios(max_image_tiles)
445
+
446
+ aspect_ratios_ids = np.zeros((batch_size, max_num_images), dtype=np.int64)
447
+ for i, sample_aspect_ratios in enumerate(aspect_ratios):
448
+ for j, (num_tiles_h, num_tiles_w) in enumerate(sample_aspect_ratios):
449
+ aspect_ratios_ids[i, j] = supported_aspect_ratios.index((num_tiles_h, num_tiles_w)) + 1
450
+ return aspect_ratios_ids
451
+
452
+
453
+ def to_channel_dimension_format(
454
+ image: np.ndarray,
455
+ channel_dim: Union[ChannelDimension, str],
456
+ input_channel_dim: Optional[Union[ChannelDimension, str]] = None,
457
+ ) -> np.ndarray:
458
+ """
459
+ Converts `image` to the channel dimension format specified by `channel_dim`.
460
+
461
+ Args:
462
+ image (`numpy.ndarray`):
463
+ The image to have its channel dimension set.
464
+ channel_dim (`ChannelDimension`):
465
+ The channel dimension format to use.
466
+ input_channel_dim (`ChannelDimension`, *optional*):
467
+ The channel dimension format of the input image. If not provided, it will be inferred from the input image.
468
+
469
+ Returns:
470
+ `np.ndarray`:
471
+ The image with the channel dimension set to `channel_dim`.
472
+ """
473
+ if not isinstance(image, np.ndarray):
474
+ raise ValueError(f"Input image must be of type np.ndarray, got {type(image)}")
475
+
476
+ if input_channel_dim is None:
477
+ input_channel_dim = infer_channel_dimension_format(image)
478
+
479
+ target_channel_dim = ChannelDimension(channel_dim)
480
+ if input_channel_dim == target_channel_dim:
481
+ return image
482
+
483
+ if target_channel_dim == ChannelDimension.FIRST:
484
+ image = image.transpose((2, 0, 1))
485
+ elif target_channel_dim == ChannelDimension.LAST:
486
+ image = image.transpose((1, 2, 0))
487
+ else:
488
+ raise ValueError("Unsupported channel dimension format: {}".format(channel_dim))
489
+
490
+ return image
491
+
492
+
493
+ # Copied from transformers.models.idefics2.image_processing_idefics2.convert_to_rgb
494
+ def convert_to_rgb(image: ImageInput) -> ImageInput:
495
+ """
496
+ Converts an image to RGB format. Only converts if the image is of type PIL.Image.Image, otherwise returns the image
497
+ as is.
498
+ Args:
499
+ image (Image):
500
+ The image to convert.
501
+ """
502
+ if not isinstance(image, PIL.Image.Image):
503
+ return image
504
+
505
+ # `image.convert("RGB")` would only work for .jpg images, as it creates a wrong background
506
+ # for transparent images. The call to `alpha_composite` handles this case
507
+ if image.mode == "RGB":
508
+ return image
509
+
510
+ image_rgba = image.convert("RGBA")
511
+ background = Image.new("RGBA", image_rgba.size, (255, 255, 255))
512
+ alpha_composite = Image.alpha_composite(background, image_rgba)
513
+ alpha_composite = alpha_composite.convert("RGB")
514
+ return alpha_composite
515
+
516
+
517
+ # Modified from transformers.models.idefics2.image_processing_idefics2.make_list_of_images
518
+ def make_list_of_images(images: ImageInput) -> List[List[Optional[np.ndarray]]]:
519
+ """
520
+ Convert a single image or a list of images to a list of numpy arrays.
521
+
522
+ Args:
523
+ images (`ImageInput`):
524
+ A single image or a list of images.
525
+
526
+ Returns:
527
+ A list of numpy arrays.
528
+ """
529
+ # If it's a single image, convert it to a list of lists
530
+ if is_valid_image(images):
531
+ output_images = [[images]]
532
+ # If it's a list of images, it's a single batch, so convert it to a list of lists
533
+ elif isinstance(images, (list, tuple)) and is_valid_list_of_images(images):
534
+ output_images = [images]
535
+ # If it's a list of batches, it's already in the right format
536
+ elif (
537
+ isinstance(images, (list, tuple))
538
+ and all(isinstance(images_i, (list, tuple)) for images_i in images)
539
+ and any(is_valid_list_of_images(images_i) for images_i in images)
540
+ ):
541
+ output_images = images
542
+ else:
543
+ raise ValueError(
544
+ "Invalid input type. Must be a single image, a list of images, or a list of batches of images."
545
+ )
546
+ return output_images
547
+
548
+
549
+ def is_valid_list_of_images(images: List):
550
+ return images and all(is_valid_image(image) for image in images)
551
+
552
+
553
+ def _validate_size(size: Dict[str, int]) -> None:
554
+ if not ("height" in size and "width" in size):
555
+ raise ValueError(f"Argument `size` must be a dictionary with keys 'height' and 'width'. Got: {size}")
556
+ if size["height"] != size["width"]:
557
+ raise ValueError(f"Argument `size` must have the same height and width, got {size}")
558
+
559
+
560
+ def _validate_mllama_preprocess_arguments(do_resize, size, do_pad, max_image_tiles):
561
+ if not do_pad:
562
+ raise ValueError("VideoMllamaImageProcessor doesn't support `do_pad=False` mode.")
563
+ if not do_resize:
564
+ raise ValueError("VideoMllamaImageProcessor doesn't support `do_resize=False` mode.")
565
+ if max_image_tiles is None or max_image_tiles <= 0:
566
+ raise ValueError(f"VideoMllamaImageProcessor `max_image_tiles` must be a positive integer, got {max_image_tiles}.")
567
+ _validate_size(size)
568
+
569
+
570
+ class VideoMllamaImageProcessor(BaseImageProcessor):
571
+ """
572
+ Constructs a VideoMllama image processor.
573
+
574
+ Args:
575
+ do_convert_rgb (`bool`, *optional*, defaults to `True`):
576
+ Whether to convert the image to RGB. This is useful if the input image is of a different format e.g. RGBA.
577
+ Only has an effect if the input image is in the PIL format.
578
+ do_resize (`bool`, *optional*, defaults to `True`):
579
+ Whether to resize the image.
580
+ size (`Dict[str, int]`, *optional*, defaults to `self.size`):
581
+ Size of the image tile. Should be a dictionary containing 'height' and 'width' keys, both with integer values.
582
+ The height and width values should be equal.
583
+ resample (`int`, *optional*, defaults to `Resampling.BILINEAR`):
584
+ Resampling filter to use if resizing the image. This can be one of the enum `PILImageResampling`. Only
585
+ has an effect if `do_resize` is set to `True`.
586
+ do_rescale (`bool`, *optional*, defaults to `True`):
587
+ Whether to rescale the image.
588
+ rescale_factor (`float`, *optional*, defaults to 0.0):
589
+ Rescale factor to rescale the image by if `do_rescale` is set to `True`.
590
+ do_normalize (`bool`, *optional*, defaults to `True`):
591
+ Whether to normalize the image.
592
+ image_mean (`float` or `List[float]`, *optional*, defaults to `self.image_mean`):
593
+ Image mean to use for normalization. Only has an effect if `do_normalize` is set to `True`.
594
+ image_std (`float` or `List[float]`, *optional*, defaults to `self.image_std`):
595
+ Image standard deviation to use for normalization. Only has an effect if `do_normalize` is set to
596
+ `True`.
597
+ do_pad (`bool`, *optional*, defaults to `True`):
598
+ Whether or not to pad the images to the largest height and width in the batch.
599
+ max_image_tiles (`int`, *optional*, defaults to 4):
600
+ The maximum number of tiles to split the image into.
601
+ """
602
+
603
+ model_input_names = ["pixel_values", "num_tiles", "aspect_ratio_ids", "aspect_ratio_mask"]
604
+
605
+ def __init__(
606
+ self,
607
+ do_convert_rgb: bool = True,
608
+ do_resize: bool = True,
609
+ size: Optional[Dict[str, int]] = None,
610
+ resample: PILImageResampling = PILImageResampling.BILINEAR,
611
+ do_rescale: bool = True,
612
+ rescale_factor: float = 1 / 255,
613
+ do_normalize: bool = True,
614
+ image_mean: Optional[Union[float, List[float]]] = None,
615
+ image_std: Optional[Union[float, List[float]]] = None,
616
+ do_pad: bool = True,
617
+ max_image_tiles: int = 4,
618
+ **kwargs,
619
+ ) -> None:
620
+ super().__init__(**kwargs)
621
+ self.do_convert_rgb = do_convert_rgb
622
+ self.do_resize = do_resize
623
+ self.size = size if size is not None else {"height": 224, "width": 224}
624
+ self.resample = resample
625
+ self.do_rescale = do_rescale
626
+ self.rescale_factor = rescale_factor
627
+ self.do_normalize = do_normalize
628
+ self.image_mean = image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
629
+ self.image_std = image_std if image_std is not None else IMAGENET_STANDARD_STD
630
+ self.do_pad = do_pad
631
+ self.max_image_tiles = max_image_tiles
632
+
633
+ _validate_mllama_preprocess_arguments(self.do_resize, self.size, self.do_pad, self.max_image_tiles)
634
+
635
+ def preprocess(
636
+ self,
637
+ images: ImageInput,
638
+ do_convert_rgb: Optional[bool] = None,
639
+ do_resize: Optional[bool] = None,
640
+ size: Optional[Dict[str, int]] = None,
641
+ resample: Optional[PILImageResampling] = None,
642
+ do_rescale: Optional[bool] = None,
643
+ rescale_factor: Optional[float] = None,
644
+ do_normalize: Optional[bool] = None,
645
+ image_mean: Optional[Union[float, List[float]]] = None,
646
+ image_std: Optional[Union[float, List[float]]] = None,
647
+ do_pad: Optional[bool] = None,
648
+ max_image_tiles: Optional[int] = None,
649
+ input_data_format: Optional[Union[str, ChannelDimension]] = None,
650
+ return_tensors: Optional[Union[str, TensorType]] = None,
651
+ ):
652
+ """
653
+ Preprocess a batch of images.
654
+
655
+ Args:
656
+ images (`ImageInput`):
657
+ A list of images to preprocess.
658
+ do_convert_rgb (`bool`, *optional*, defaults to `self.do_convert_rgb`):
659
+ Whether to convert the image to RGB.
660
+ do_resize (`bool`, *optional*, defaults to `self.do_resize`):
661
+ Whether to resize the image.
662
+ size (`Dict[str, int]`, *optional*, defaults to `self.size`):
663
+ Size of the image tile. Should be a dictionary containing 'height' and 'width' keys, both with integer values.
664
+ The height and width values should be equal.
665
+ resample (`int`, *optional*, defaults to `self.resample`):
666
+ Resampling filter to use if resizing the image. This can be one of the enum `PILImageResampling`. Only
667
+ has an effect if `do_resize` is set to `True`.
668
+ do_rescale (`bool`, *optional*, defaults to `self.do_rescale`):
669
+ Whether to rescale the image.
670
+ rescale_factor (`float`, *optional*, defaults to `self.rescale_factor`):
671
+ Rescale factor to rescale the image by if `do_rescale` is set to `True`.
672
+ do_normalize (`bool`, *optional*, defaults to `self.do_normalize`):
673
+ Whether to normalize the image.
674
+ image_mean (`float` or `List[float]`, *optional*, defaults to `self.image_mean`):
675
+ Image mean to use for normalization. Only has an effect if `do_normalize` is set to `True`.
676
+ image_std (`float` or `List[float]`, *optional*, defaults to `self.image_std`):
677
+ Image standard deviation to use for normalization. Only has an effect if `do_normalize` is set to
678
+ `True`.
679
+ do_pad (`bool`, *optional*, defaults to `self.do_pad`):
680
+ Whether or not to pad the images to the largest height and width in the batch.
681
+ max_image_tiles (`int`, *optional*, defaults to `self.max_image_tiles`):
682
+ The maximum number of tiles to split the image into.
683
+ input_data_format (`ChannelDimension` or `str`, *optional*):
684
+ The channel dimension format for the input image. If unset, the channel dimension format is inferred
685
+ from the input image. Can be one of:
686
+ - `"channels_first"` or `ChannelDimension.FIRST`: image in (num_channels, height, width) format.
687
+ - `"channels_last"` or `ChannelDimension.LAST`: image in (height, width, num_channels) format.
688
+ - `"none"` or `ChannelDimension.NONE`: image in (height, width) format.
689
+ return_tensors (`str` or `TensorType`, *optional*):
690
+ The type of tensors to return. Can be one of:
691
+ - Unset: Return a list of `np.ndarray`.
692
+ - `TensorType.TENSORFLOW` or `'tf'`: Return a batch of type `tf.Tensor`.
693
+ - `TensorType.PYTORCH` or `'pt'`: Return a batch of type `torch.Tensor`.
694
+ - `TensorType.NUMPY` or `'np'`: Return a batch of type `np.ndarray`.
695
+ - `TensorType.JAX` or `'jax'`: Return a batch of type `jax.numpy.ndarray`.
696
+
697
+ Returns:
698
+ `BatchFeature` of the following structure:
699
+ - **pixel_values** (`TensorType`): The preprocessed pixel values.
700
+ - **aspect_ratio_ids** (`TensorType`): The aspect ratio ids of the images.
701
+ - **num_tiles** (`List[List[int]]`): The number of tiles for each image in the batch.
702
+ """
703
+ do_convert_rgb = do_convert_rgb if do_convert_rgb is not None else self.do_convert_rgb
704
+ do_resize = do_resize if do_resize is not None else self.do_resize
705
+ size = size if size is not None else self.size
706
+ resample = resample if resample is not None else self.resample
707
+ do_rescale = do_rescale if do_rescale is not None else self.do_rescale
708
+ rescale_factor = rescale_factor if rescale_factor is not None else self.rescale_factor
709
+ do_normalize = do_normalize if do_normalize is not None else self.do_normalize
710
+ image_mean = image_mean if image_mean is not None else self.image_mean
711
+ image_std = image_std if image_std is not None else self.image_std
712
+ do_pad = do_pad if do_pad is not None else self.do_pad
713
+ max_image_tiles = max_image_tiles if max_image_tiles is not None else self.max_image_tiles
714
+
715
+ validate_preprocess_arguments(
716
+ do_rescale=do_rescale,
717
+ rescale_factor=rescale_factor,
718
+ do_normalize=do_normalize,
719
+ image_mean=image_mean,
720
+ image_std=image_std,
721
+ do_resize=do_resize,
722
+ size=size,
723
+ resample=resample,
724
+ )
725
+
726
+ # extra validation
727
+ _validate_mllama_preprocess_arguments(do_resize, size, do_pad, max_image_tiles)
728
+
729
+ images_list = make_list_of_images(images)
730
+
731
+ if self.do_convert_rgb:
732
+ images_list = [[convert_to_rgb(image) for image in images] for images in images_list]
733
+
734
+ images_list = [[to_numpy_array(image) for image in images] for images in images_list]
735
+
736
+ batch_images = []
737
+ batch_aspect_ratios = []
738
+
739
+ # iterate over batch samples
740
+ for images in images_list:
741
+ sample_images = []
742
+ sample_aspect_ratios = []
743
+
744
+ # iterate over images in a batch sample
745
+ for image in images:
746
+ # convert images to channels first format for faster processing
747
+ # LAST is slower for `pad` and not supported by `split_to_tiles`
748
+ data_format = ChannelDimension.FIRST
749
+ image = to_channel_dimension_format(image, data_format, input_channel_dim=input_data_format)
750
+
751
+ # do_resize=False is not supported, validated
752
+ image, aspect_ratio = self.resize(
753
+ image=image,
754
+ size=size,
755
+ resample=resample,
756
+ max_image_tiles=max_image_tiles,
757
+ input_data_format=data_format,
758
+ data_format=data_format,
759
+ )
760
+
761
+ # do_pad=False is not supported, validated
762
+ image = self.pad(
763
+ image=image,
764
+ size=size,
765
+ aspect_ratio=aspect_ratio,
766
+ input_data_format=data_format,
767
+ data_format=data_format,
768
+ )
769
+
770
+ if do_rescale:
771
+ image = self.rescale(
772
+ image=image,
773
+ scale=rescale_factor,
774
+ input_data_format=input_data_format,
775
+ data_format=data_format,
776
+ )
777
+
778
+ if do_normalize:
779
+ image = self.normalize(
780
+ image=image,
781
+ mean=image_mean,
782
+ std=image_std,
783
+ input_data_format=input_data_format,
784
+ data_format=data_format,
785
+ )
786
+
787
+ num_tiles_height, num_tiles_width = aspect_ratio
788
+ image = split_to_tiles(image, num_tiles_height, num_tiles_width)
789
+
790
+ sample_images.append(image)
791
+ sample_aspect_ratios.append((num_tiles_height, num_tiles_width))
792
+
793
+ batch_images.append(sample_images)
794
+ batch_aspect_ratios.append(sample_aspect_ratios)
795
+
796
+ images, num_tiles = pack_images(batch_images, max_image_tiles)
797
+
798
+ aspect_ratio_ids = convert_aspect_ratios_to_ids(batch_aspect_ratios, max_image_tiles=max_image_tiles)
799
+ aspect_ratio_mask = build_aspect_ratio_mask(batch_aspect_ratios, max_image_tiles=max_image_tiles)
800
+
801
+ # images (np.ndarray) with shape (batch_size, max_num_images, max_image_tiles, channels, tile_height, tile_width)
802
+ # aspect_ratio_ids (np.ndarray) with shape (batch_size, max_num_images) - aspect ratio ids for each image, padded to max_num_images with 0
803
+ # num_tiles (List[List[int]]) with (batch_size, num_images_in_batch) - real number of tiles for each image, not padded
804
+ # aspect_ratio_mask (np.ndarray) with shape (batch_size, max_num_images, max_image_tiles) - number of tiles for each image, padded to max_num_images with 0
805
+ encoded_inputs = BatchFeature(
806
+ data={
807
+ "pixel_values": images,
808
+ "aspect_ratio_ids": aspect_ratio_ids,
809
+ "aspect_ratio_mask": aspect_ratio_mask,
810
+ },
811
+ tensor_type=return_tensors,
812
+ )
813
+ encoded_inputs["num_tiles"] = num_tiles
814
+
815
+ return encoded_inputs
816
+
817
+ def pad(
818
+ self,
819
+ image: np.ndarray,
820
+ size: Dict[str, int],
821
+ aspect_ratio: Tuple[int, int],
822
+ data_format: Optional[Union[str, ChannelDimension]] = None,
823
+ input_data_format: Optional[Union[str, ChannelDimension]] = None,
824
+ ) -> np.ndarray:
825
+ """
826
+ Pad an image to the `size` x `aspect_ratio`. For example, if size is {height: 224, width: 224} and aspect ratio is
827
+ (1, 2), the image will be padded to 224x448.
828
+
829
+ Args:
830
+ image (`np.ndarray`):
831
+ Image to resize.
832
+ size (`Dict[str, int]`):
833
+ Size of the output image.
834
+ aspect_ratio (`Tuple[int, int]`):
835
+ The aspect ratio of the image.
836
+ data_format (`str` or `ChannelDimension`, *optional*):
837
+ The channel dimension format of the image. If not provided, it will be the same as the input image.
838
+ input_data_format (`ChannelDimension` or `str`, *optional*):
839
+ The channel dimension format of the input image. If not provided, it will be inferred.
840
+
841
+ Returns:
842
+ `np.ndarray`: The padded image.
843
+ """
844
+
845
+ _validate_size(size)
846
+
847
+ image_height, image_width = get_image_size(image, channel_dim=input_data_format)
848
+ num_tiles_height, num_tiles_width = aspect_ratio
849
+ padded_height = num_tiles_height * size["height"]
850
+ padded_width = num_tiles_width * size["width"]
851
+ pad_size = ((0, padded_height - image_height), (0, padded_width - image_width))
852
+
853
+ image = pad(
854
+ image,
855
+ pad_size,
856
+ mode=PaddingMode.CONSTANT,
857
+ constant_values=0,
858
+ data_format=data_format,
859
+ input_data_format=input_data_format,
860
+ )
861
+
862
+ return image
863
+
864
+ def resize(
865
+ self,
866
+ image: np.ndarray,
867
+ size: Dict[str, int],
868
+ max_image_tiles: int,
869
+ resample: PILImageResampling = PILImageResampling.BILINEAR,
870
+ data_format: Optional[Union[str, ChannelDimension]] = None,
871
+ input_data_format: Optional[Union[str, ChannelDimension]] = None,
872
+ ) -> Union[np.ndarray, Tuple[int, int]]:
873
+ """
874
+ Resizes an image to fit within a tiled canvas while maintaining its aspect ratio.
875
+ The optimal canvas size is calculated based on the maximum number of tiles and the tile size.
876
+
877
+ The function first determines the best tile arrangement for the image, then resizes the image
878
+ to fit within this canvas. The resized image and the number of tiles along the height and width
879
+ dimensions are returned.
880
+
881
+ Args:
882
+ image (`np.ndarray`):
883
+ Image to resize.
884
+ size (`Dict[str, int]`):
885
+ Size of the output image.
886
+ max_image_tiles (`int`):
887
+ The maximum number of tiles to split the image into.
888
+ resample (`PILImageResampling`, *optional*, defaults to `PILImageResampling.BICUBIC`):
889
+ Resampling filter to use when resizing the image.
890
+ data_format (`str` or `ChannelDimension`, *optional*):
891
+ The channel dimension format of the image. If not provided, it will be the same as the input image.
892
+ input_data_format (`ChannelDimension` or `str`, *optional*):
893
+ The channel dimension format of the input image. If not provided, it will be inferred.
894
+
895
+ Returns:
896
+ `Union[np.ndarray, Tuple[int, int]]`: The resized image and a tuple containing the number of tiles
897
+ along the height and width dimensions.
898
+ """
899
+
900
+ _validate_size(size)
901
+
902
+ image_height, image_width = get_image_size(image, channel_dim=input_data_format)
903
+ tile_size = size["height"]
904
+
905
+ canvas_height, canvas_width = get_optimal_tiled_canvas(
906
+ image_height=image_height,
907
+ image_width=image_width,
908
+ max_image_tiles=max_image_tiles,
909
+ tile_size=tile_size,
910
+ )
911
+ num_tiles_height = canvas_height // tile_size
912
+ num_tiles_width = canvas_width // tile_size
913
+
914
+ new_height, new_width = get_image_size_fit_to_canvas(
915
+ image_height=image_height,
916
+ image_width=image_width,
917
+ canvas_height=canvas_height,
918
+ canvas_width=canvas_width,
919
+ tile_size=tile_size,
920
+ )
921
+
922
+ image = resize(
923
+ image,
924
+ (new_height, new_width),
925
+ resample=resample,
926
+ data_format=data_format,
927
+ input_data_format=input_data_format,
928
+ )
929
+
930
+ return image, (num_tiles_height, num_tiles_width)
model-00001-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3856e9b7be62a35d52345188c1351d3e416e50a27b7b55bd35cf6cbf92df9bb1
3
+ size 4992622346
model-00002-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3705401c8019c1da4e89a0b455987caea2f7d67876216977f783391403daa1dd
3
+ size 4966251712
model-00003-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b2da1fde87a1307d8474f8768be67d90ae0c95e967a8e39da244ef95f11939e
3
+ size 4915919704
model-00004-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42882da52f6e12bbe1ebe6e3e665e81250eb5c006af9b9b925cb53d1ded1e6df
3
+ size 4999823980
model-00005-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85e05f959747e2d133c5f59d5357aaa1fd304017bfbd73778feb06f5b609cd5c
3
+ size 1465943128
model.safetensors.index.json ADDED
@@ -0,0 +1,913 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 21340441670
4
+ },
5
+ "weight_map": {
6
+ "language_model.lm_head.weight": "model-00005-of-00005.safetensors",
7
+ "language_model.model.embed_tokens.weight": "model-00001-of-00005.safetensors",
8
+ "language_model.model.layers.0.input_layernorm.weight": "model-00001-of-00005.safetensors",
9
+ "language_model.model.layers.0.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
10
+ "language_model.model.layers.0.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
11
+ "language_model.model.layers.0.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
12
+ "language_model.model.layers.0.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
13
+ "language_model.model.layers.0.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
14
+ "language_model.model.layers.0.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
15
+ "language_model.model.layers.0.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
16
+ "language_model.model.layers.0.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
17
+ "language_model.model.layers.1.input_layernorm.weight": "model-00001-of-00005.safetensors",
18
+ "language_model.model.layers.1.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
19
+ "language_model.model.layers.1.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
20
+ "language_model.model.layers.1.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
21
+ "language_model.model.layers.1.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
22
+ "language_model.model.layers.1.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
23
+ "language_model.model.layers.1.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
24
+ "language_model.model.layers.1.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
25
+ "language_model.model.layers.1.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
26
+ "language_model.model.layers.10.input_layernorm.weight": "model-00002-of-00005.safetensors",
27
+ "language_model.model.layers.10.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
28
+ "language_model.model.layers.10.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
29
+ "language_model.model.layers.10.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
30
+ "language_model.model.layers.10.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
31
+ "language_model.model.layers.10.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
32
+ "language_model.model.layers.10.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
33
+ "language_model.model.layers.10.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
34
+ "language_model.model.layers.10.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
35
+ "language_model.model.layers.11.input_layernorm.weight": "model-00002-of-00005.safetensors",
36
+ "language_model.model.layers.11.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
37
+ "language_model.model.layers.11.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
38
+ "language_model.model.layers.11.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
39
+ "language_model.model.layers.11.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
40
+ "language_model.model.layers.11.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
41
+ "language_model.model.layers.11.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
42
+ "language_model.model.layers.11.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
43
+ "language_model.model.layers.11.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
44
+ "language_model.model.layers.12.input_layernorm.weight": "model-00002-of-00005.safetensors",
45
+ "language_model.model.layers.12.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
46
+ "language_model.model.layers.12.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
47
+ "language_model.model.layers.12.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
48
+ "language_model.model.layers.12.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
49
+ "language_model.model.layers.12.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
50
+ "language_model.model.layers.12.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
51
+ "language_model.model.layers.12.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
52
+ "language_model.model.layers.12.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
53
+ "language_model.model.layers.13.cross_attn.k_norm.weight": "model-00002-of-00005.safetensors",
54
+ "language_model.model.layers.13.cross_attn.k_proj.weight": "model-00002-of-00005.safetensors",
55
+ "language_model.model.layers.13.cross_attn.o_proj.weight": "model-00002-of-00005.safetensors",
56
+ "language_model.model.layers.13.cross_attn.q_norm.weight": "model-00002-of-00005.safetensors",
57
+ "language_model.model.layers.13.cross_attn.q_proj.weight": "model-00002-of-00005.safetensors",
58
+ "language_model.model.layers.13.cross_attn.v_proj.weight": "model-00002-of-00005.safetensors",
59
+ "language_model.model.layers.13.cross_attn_attn_gate": "model-00002-of-00005.safetensors",
60
+ "language_model.model.layers.13.cross_attn_mlp_gate": "model-00002-of-00005.safetensors",
61
+ "language_model.model.layers.13.input_layernorm.weight": "model-00002-of-00005.safetensors",
62
+ "language_model.model.layers.13.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
63
+ "language_model.model.layers.13.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
64
+ "language_model.model.layers.13.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
65
+ "language_model.model.layers.13.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
66
+ "language_model.model.layers.14.input_layernorm.weight": "model-00002-of-00005.safetensors",
67
+ "language_model.model.layers.14.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
68
+ "language_model.model.layers.14.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
69
+ "language_model.model.layers.14.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
70
+ "language_model.model.layers.14.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
71
+ "language_model.model.layers.14.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
72
+ "language_model.model.layers.14.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
73
+ "language_model.model.layers.14.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
74
+ "language_model.model.layers.14.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
75
+ "language_model.model.layers.15.input_layernorm.weight": "model-00002-of-00005.safetensors",
76
+ "language_model.model.layers.15.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
77
+ "language_model.model.layers.15.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
78
+ "language_model.model.layers.15.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
79
+ "language_model.model.layers.15.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
80
+ "language_model.model.layers.15.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
81
+ "language_model.model.layers.15.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
82
+ "language_model.model.layers.15.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
83
+ "language_model.model.layers.15.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
84
+ "language_model.model.layers.16.input_layernorm.weight": "model-00003-of-00005.safetensors",
85
+ "language_model.model.layers.16.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
86
+ "language_model.model.layers.16.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
87
+ "language_model.model.layers.16.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
88
+ "language_model.model.layers.16.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
89
+ "language_model.model.layers.16.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
90
+ "language_model.model.layers.16.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
91
+ "language_model.model.layers.16.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
92
+ "language_model.model.layers.16.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
93
+ "language_model.model.layers.17.input_layernorm.weight": "model-00003-of-00005.safetensors",
94
+ "language_model.model.layers.17.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
95
+ "language_model.model.layers.17.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
96
+ "language_model.model.layers.17.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
97
+ "language_model.model.layers.17.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
98
+ "language_model.model.layers.17.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
99
+ "language_model.model.layers.17.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
100
+ "language_model.model.layers.17.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
101
+ "language_model.model.layers.17.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
102
+ "language_model.model.layers.18.cross_attn.k_norm.weight": "model-00003-of-00005.safetensors",
103
+ "language_model.model.layers.18.cross_attn.k_proj.weight": "model-00003-of-00005.safetensors",
104
+ "language_model.model.layers.18.cross_attn.o_proj.weight": "model-00003-of-00005.safetensors",
105
+ "language_model.model.layers.18.cross_attn.q_norm.weight": "model-00003-of-00005.safetensors",
106
+ "language_model.model.layers.18.cross_attn.q_proj.weight": "model-00003-of-00005.safetensors",
107
+ "language_model.model.layers.18.cross_attn.v_proj.weight": "model-00003-of-00005.safetensors",
108
+ "language_model.model.layers.18.cross_attn_attn_gate": "model-00003-of-00005.safetensors",
109
+ "language_model.model.layers.18.cross_attn_mlp_gate": "model-00003-of-00005.safetensors",
110
+ "language_model.model.layers.18.input_layernorm.weight": "model-00003-of-00005.safetensors",
111
+ "language_model.model.layers.18.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
112
+ "language_model.model.layers.18.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
113
+ "language_model.model.layers.18.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
114
+ "language_model.model.layers.18.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
115
+ "language_model.model.layers.19.input_layernorm.weight": "model-00003-of-00005.safetensors",
116
+ "language_model.model.layers.19.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
117
+ "language_model.model.layers.19.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
118
+ "language_model.model.layers.19.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
119
+ "language_model.model.layers.19.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
120
+ "language_model.model.layers.19.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
121
+ "language_model.model.layers.19.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
122
+ "language_model.model.layers.19.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
123
+ "language_model.model.layers.19.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
124
+ "language_model.model.layers.2.input_layernorm.weight": "model-00001-of-00005.safetensors",
125
+ "language_model.model.layers.2.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
126
+ "language_model.model.layers.2.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
127
+ "language_model.model.layers.2.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
128
+ "language_model.model.layers.2.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
129
+ "language_model.model.layers.2.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
130
+ "language_model.model.layers.2.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
131
+ "language_model.model.layers.2.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
132
+ "language_model.model.layers.2.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
133
+ "language_model.model.layers.20.input_layernorm.weight": "model-00003-of-00005.safetensors",
134
+ "language_model.model.layers.20.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
135
+ "language_model.model.layers.20.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
136
+ "language_model.model.layers.20.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
137
+ "language_model.model.layers.20.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
138
+ "language_model.model.layers.20.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
139
+ "language_model.model.layers.20.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
140
+ "language_model.model.layers.20.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
141
+ "language_model.model.layers.20.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
142
+ "language_model.model.layers.21.input_layernorm.weight": "model-00003-of-00005.safetensors",
143
+ "language_model.model.layers.21.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
144
+ "language_model.model.layers.21.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
145
+ "language_model.model.layers.21.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
146
+ "language_model.model.layers.21.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
147
+ "language_model.model.layers.21.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
148
+ "language_model.model.layers.21.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
149
+ "language_model.model.layers.21.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
150
+ "language_model.model.layers.21.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
151
+ "language_model.model.layers.22.input_layernorm.weight": "model-00003-of-00005.safetensors",
152
+ "language_model.model.layers.22.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
153
+ "language_model.model.layers.22.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
154
+ "language_model.model.layers.22.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
155
+ "language_model.model.layers.22.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
156
+ "language_model.model.layers.22.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
157
+ "language_model.model.layers.22.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
158
+ "language_model.model.layers.22.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
159
+ "language_model.model.layers.22.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
160
+ "language_model.model.layers.23.cross_attn.k_norm.weight": "model-00003-of-00005.safetensors",
161
+ "language_model.model.layers.23.cross_attn.k_proj.weight": "model-00003-of-00005.safetensors",
162
+ "language_model.model.layers.23.cross_attn.o_proj.weight": "model-00003-of-00005.safetensors",
163
+ "language_model.model.layers.23.cross_attn.q_norm.weight": "model-00003-of-00005.safetensors",
164
+ "language_model.model.layers.23.cross_attn.q_proj.weight": "model-00003-of-00005.safetensors",
165
+ "language_model.model.layers.23.cross_attn.v_proj.weight": "model-00003-of-00005.safetensors",
166
+ "language_model.model.layers.23.cross_attn_attn_gate": "model-00003-of-00005.safetensors",
167
+ "language_model.model.layers.23.cross_attn_mlp_gate": "model-00003-of-00005.safetensors",
168
+ "language_model.model.layers.23.input_layernorm.weight": "model-00003-of-00005.safetensors",
169
+ "language_model.model.layers.23.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
170
+ "language_model.model.layers.23.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
171
+ "language_model.model.layers.23.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
172
+ "language_model.model.layers.23.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
173
+ "language_model.model.layers.24.input_layernorm.weight": "model-00003-of-00005.safetensors",
174
+ "language_model.model.layers.24.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
175
+ "language_model.model.layers.24.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
176
+ "language_model.model.layers.24.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
177
+ "language_model.model.layers.24.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
178
+ "language_model.model.layers.24.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
179
+ "language_model.model.layers.24.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
180
+ "language_model.model.layers.24.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
181
+ "language_model.model.layers.24.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
182
+ "language_model.model.layers.25.input_layernorm.weight": "model-00003-of-00005.safetensors",
183
+ "language_model.model.layers.25.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
184
+ "language_model.model.layers.25.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
185
+ "language_model.model.layers.25.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
186
+ "language_model.model.layers.25.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
187
+ "language_model.model.layers.25.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
188
+ "language_model.model.layers.25.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
189
+ "language_model.model.layers.25.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
190
+ "language_model.model.layers.25.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
191
+ "language_model.model.layers.26.input_layernorm.weight": "model-00003-of-00005.safetensors",
192
+ "language_model.model.layers.26.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
193
+ "language_model.model.layers.26.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
194
+ "language_model.model.layers.26.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
195
+ "language_model.model.layers.26.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
196
+ "language_model.model.layers.26.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
197
+ "language_model.model.layers.26.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
198
+ "language_model.model.layers.26.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
199
+ "language_model.model.layers.26.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
200
+ "language_model.model.layers.27.input_layernorm.weight": "model-00004-of-00005.safetensors",
201
+ "language_model.model.layers.27.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
202
+ "language_model.model.layers.27.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
203
+ "language_model.model.layers.27.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
204
+ "language_model.model.layers.27.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
205
+ "language_model.model.layers.27.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
206
+ "language_model.model.layers.27.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
207
+ "language_model.model.layers.27.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
208
+ "language_model.model.layers.27.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
209
+ "language_model.model.layers.28.cross_attn.k_norm.weight": "model-00004-of-00005.safetensors",
210
+ "language_model.model.layers.28.cross_attn.k_proj.weight": "model-00004-of-00005.safetensors",
211
+ "language_model.model.layers.28.cross_attn.o_proj.weight": "model-00004-of-00005.safetensors",
212
+ "language_model.model.layers.28.cross_attn.q_norm.weight": "model-00004-of-00005.safetensors",
213
+ "language_model.model.layers.28.cross_attn.q_proj.weight": "model-00004-of-00005.safetensors",
214
+ "language_model.model.layers.28.cross_attn.v_proj.weight": "model-00004-of-00005.safetensors",
215
+ "language_model.model.layers.28.cross_attn_attn_gate": "model-00004-of-00005.safetensors",
216
+ "language_model.model.layers.28.cross_attn_mlp_gate": "model-00004-of-00005.safetensors",
217
+ "language_model.model.layers.28.input_layernorm.weight": "model-00004-of-00005.safetensors",
218
+ "language_model.model.layers.28.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
219
+ "language_model.model.layers.28.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
220
+ "language_model.model.layers.28.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
221
+ "language_model.model.layers.28.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
222
+ "language_model.model.layers.29.input_layernorm.weight": "model-00004-of-00005.safetensors",
223
+ "language_model.model.layers.29.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
224
+ "language_model.model.layers.29.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
225
+ "language_model.model.layers.29.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
226
+ "language_model.model.layers.29.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
227
+ "language_model.model.layers.29.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
228
+ "language_model.model.layers.29.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
229
+ "language_model.model.layers.29.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
230
+ "language_model.model.layers.29.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
231
+ "language_model.model.layers.3.cross_attn.k_norm.weight": "model-00001-of-00005.safetensors",
232
+ "language_model.model.layers.3.cross_attn.k_proj.weight": "model-00001-of-00005.safetensors",
233
+ "language_model.model.layers.3.cross_attn.o_proj.weight": "model-00001-of-00005.safetensors",
234
+ "language_model.model.layers.3.cross_attn.q_norm.weight": "model-00001-of-00005.safetensors",
235
+ "language_model.model.layers.3.cross_attn.q_proj.weight": "model-00001-of-00005.safetensors",
236
+ "language_model.model.layers.3.cross_attn.v_proj.weight": "model-00001-of-00005.safetensors",
237
+ "language_model.model.layers.3.cross_attn_attn_gate": "model-00001-of-00005.safetensors",
238
+ "language_model.model.layers.3.cross_attn_mlp_gate": "model-00001-of-00005.safetensors",
239
+ "language_model.model.layers.3.input_layernorm.weight": "model-00001-of-00005.safetensors",
240
+ "language_model.model.layers.3.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
241
+ "language_model.model.layers.3.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
242
+ "language_model.model.layers.3.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
243
+ "language_model.model.layers.3.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
244
+ "language_model.model.layers.30.input_layernorm.weight": "model-00004-of-00005.safetensors",
245
+ "language_model.model.layers.30.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
246
+ "language_model.model.layers.30.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
247
+ "language_model.model.layers.30.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
248
+ "language_model.model.layers.30.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
249
+ "language_model.model.layers.30.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
250
+ "language_model.model.layers.30.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
251
+ "language_model.model.layers.30.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
252
+ "language_model.model.layers.30.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
253
+ "language_model.model.layers.31.input_layernorm.weight": "model-00004-of-00005.safetensors",
254
+ "language_model.model.layers.31.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
255
+ "language_model.model.layers.31.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
256
+ "language_model.model.layers.31.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
257
+ "language_model.model.layers.31.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
258
+ "language_model.model.layers.31.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
259
+ "language_model.model.layers.31.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
260
+ "language_model.model.layers.31.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
261
+ "language_model.model.layers.31.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
262
+ "language_model.model.layers.32.input_layernorm.weight": "model-00004-of-00005.safetensors",
263
+ "language_model.model.layers.32.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
264
+ "language_model.model.layers.32.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
265
+ "language_model.model.layers.32.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
266
+ "language_model.model.layers.32.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
267
+ "language_model.model.layers.32.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
268
+ "language_model.model.layers.32.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
269
+ "language_model.model.layers.32.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
270
+ "language_model.model.layers.32.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
271
+ "language_model.model.layers.33.cross_attn.k_norm.weight": "model-00004-of-00005.safetensors",
272
+ "language_model.model.layers.33.cross_attn.k_proj.weight": "model-00004-of-00005.safetensors",
273
+ "language_model.model.layers.33.cross_attn.o_proj.weight": "model-00004-of-00005.safetensors",
274
+ "language_model.model.layers.33.cross_attn.q_norm.weight": "model-00004-of-00005.safetensors",
275
+ "language_model.model.layers.33.cross_attn.q_proj.weight": "model-00004-of-00005.safetensors",
276
+ "language_model.model.layers.33.cross_attn.v_proj.weight": "model-00004-of-00005.safetensors",
277
+ "language_model.model.layers.33.cross_attn_attn_gate": "model-00004-of-00005.safetensors",
278
+ "language_model.model.layers.33.cross_attn_mlp_gate": "model-00004-of-00005.safetensors",
279
+ "language_model.model.layers.33.input_layernorm.weight": "model-00004-of-00005.safetensors",
280
+ "language_model.model.layers.33.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
281
+ "language_model.model.layers.33.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
282
+ "language_model.model.layers.33.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
283
+ "language_model.model.layers.33.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
284
+ "language_model.model.layers.34.input_layernorm.weight": "model-00004-of-00005.safetensors",
285
+ "language_model.model.layers.34.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
286
+ "language_model.model.layers.34.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
287
+ "language_model.model.layers.34.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
288
+ "language_model.model.layers.34.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
289
+ "language_model.model.layers.34.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
290
+ "language_model.model.layers.34.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
291
+ "language_model.model.layers.34.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
292
+ "language_model.model.layers.34.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
293
+ "language_model.model.layers.35.input_layernorm.weight": "model-00004-of-00005.safetensors",
294
+ "language_model.model.layers.35.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
295
+ "language_model.model.layers.35.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
296
+ "language_model.model.layers.35.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
297
+ "language_model.model.layers.35.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
298
+ "language_model.model.layers.35.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
299
+ "language_model.model.layers.35.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
300
+ "language_model.model.layers.35.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
301
+ "language_model.model.layers.35.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
302
+ "language_model.model.layers.36.input_layernorm.weight": "model-00004-of-00005.safetensors",
303
+ "language_model.model.layers.36.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
304
+ "language_model.model.layers.36.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
305
+ "language_model.model.layers.36.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
306
+ "language_model.model.layers.36.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
307
+ "language_model.model.layers.36.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
308
+ "language_model.model.layers.36.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
309
+ "language_model.model.layers.36.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
310
+ "language_model.model.layers.36.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
311
+ "language_model.model.layers.37.input_layernorm.weight": "model-00004-of-00005.safetensors",
312
+ "language_model.model.layers.37.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
313
+ "language_model.model.layers.37.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
314
+ "language_model.model.layers.37.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
315
+ "language_model.model.layers.37.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
316
+ "language_model.model.layers.37.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
317
+ "language_model.model.layers.37.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
318
+ "language_model.model.layers.37.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
319
+ "language_model.model.layers.37.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
320
+ "language_model.model.layers.38.cross_attn.k_norm.weight": "model-00004-of-00005.safetensors",
321
+ "language_model.model.layers.38.cross_attn.k_proj.weight": "model-00004-of-00005.safetensors",
322
+ "language_model.model.layers.38.cross_attn.o_proj.weight": "model-00004-of-00005.safetensors",
323
+ "language_model.model.layers.38.cross_attn.q_norm.weight": "model-00004-of-00005.safetensors",
324
+ "language_model.model.layers.38.cross_attn.q_proj.weight": "model-00004-of-00005.safetensors",
325
+ "language_model.model.layers.38.cross_attn.v_proj.weight": "model-00004-of-00005.safetensors",
326
+ "language_model.model.layers.38.cross_attn_attn_gate": "model-00004-of-00005.safetensors",
327
+ "language_model.model.layers.38.cross_attn_mlp_gate": "model-00004-of-00005.safetensors",
328
+ "language_model.model.layers.38.input_layernorm.weight": "model-00004-of-00005.safetensors",
329
+ "language_model.model.layers.38.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
330
+ "language_model.model.layers.38.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
331
+ "language_model.model.layers.38.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
332
+ "language_model.model.layers.38.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
333
+ "language_model.model.layers.39.input_layernorm.weight": "model-00005-of-00005.safetensors",
334
+ "language_model.model.layers.39.mlp.down_proj.weight": "model-00005-of-00005.safetensors",
335
+ "language_model.model.layers.39.mlp.gate_proj.weight": "model-00005-of-00005.safetensors",
336
+ "language_model.model.layers.39.mlp.up_proj.weight": "model-00005-of-00005.safetensors",
337
+ "language_model.model.layers.39.post_attention_layernorm.weight": "model-00005-of-00005.safetensors",
338
+ "language_model.model.layers.39.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
339
+ "language_model.model.layers.39.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
340
+ "language_model.model.layers.39.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
341
+ "language_model.model.layers.39.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
342
+ "language_model.model.layers.4.input_layernorm.weight": "model-00001-of-00005.safetensors",
343
+ "language_model.model.layers.4.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
344
+ "language_model.model.layers.4.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
345
+ "language_model.model.layers.4.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
346
+ "language_model.model.layers.4.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
347
+ "language_model.model.layers.4.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
348
+ "language_model.model.layers.4.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
349
+ "language_model.model.layers.4.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
350
+ "language_model.model.layers.4.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
351
+ "language_model.model.layers.5.input_layernorm.weight": "model-00002-of-00005.safetensors",
352
+ "language_model.model.layers.5.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
353
+ "language_model.model.layers.5.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
354
+ "language_model.model.layers.5.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
355
+ "language_model.model.layers.5.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
356
+ "language_model.model.layers.5.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
357
+ "language_model.model.layers.5.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
358
+ "language_model.model.layers.5.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
359
+ "language_model.model.layers.5.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
360
+ "language_model.model.layers.6.input_layernorm.weight": "model-00002-of-00005.safetensors",
361
+ "language_model.model.layers.6.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
362
+ "language_model.model.layers.6.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
363
+ "language_model.model.layers.6.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
364
+ "language_model.model.layers.6.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
365
+ "language_model.model.layers.6.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
366
+ "language_model.model.layers.6.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
367
+ "language_model.model.layers.6.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
368
+ "language_model.model.layers.6.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
369
+ "language_model.model.layers.7.input_layernorm.weight": "model-00002-of-00005.safetensors",
370
+ "language_model.model.layers.7.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
371
+ "language_model.model.layers.7.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
372
+ "language_model.model.layers.7.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
373
+ "language_model.model.layers.7.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
374
+ "language_model.model.layers.7.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
375
+ "language_model.model.layers.7.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
376
+ "language_model.model.layers.7.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
377
+ "language_model.model.layers.7.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
378
+ "language_model.model.layers.8.cross_attn.k_norm.weight": "model-00002-of-00005.safetensors",
379
+ "language_model.model.layers.8.cross_attn.k_proj.weight": "model-00002-of-00005.safetensors",
380
+ "language_model.model.layers.8.cross_attn.o_proj.weight": "model-00002-of-00005.safetensors",
381
+ "language_model.model.layers.8.cross_attn.q_norm.weight": "model-00002-of-00005.safetensors",
382
+ "language_model.model.layers.8.cross_attn.q_proj.weight": "model-00002-of-00005.safetensors",
383
+ "language_model.model.layers.8.cross_attn.v_proj.weight": "model-00002-of-00005.safetensors",
384
+ "language_model.model.layers.8.cross_attn_attn_gate": "model-00002-of-00005.safetensors",
385
+ "language_model.model.layers.8.cross_attn_mlp_gate": "model-00002-of-00005.safetensors",
386
+ "language_model.model.layers.8.input_layernorm.weight": "model-00002-of-00005.safetensors",
387
+ "language_model.model.layers.8.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
388
+ "language_model.model.layers.8.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
389
+ "language_model.model.layers.8.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
390
+ "language_model.model.layers.8.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
391
+ "language_model.model.layers.9.input_layernorm.weight": "model-00002-of-00005.safetensors",
392
+ "language_model.model.layers.9.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
393
+ "language_model.model.layers.9.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
394
+ "language_model.model.layers.9.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
395
+ "language_model.model.layers.9.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
396
+ "language_model.model.layers.9.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
397
+ "language_model.model.layers.9.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
398
+ "language_model.model.layers.9.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
399
+ "language_model.model.layers.9.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
400
+ "language_model.model.norm.weight": "model-00005-of-00005.safetensors",
401
+ "multi_modal_projector.bias": "model-00005-of-00005.safetensors",
402
+ "multi_modal_projector.weight": "model-00005-of-00005.safetensors",
403
+ "vision_model.class_embedding": "model-00001-of-00005.safetensors",
404
+ "vision_model.gated_positional_embedding.embedding": "model-00001-of-00005.safetensors",
405
+ "vision_model.gated_positional_embedding.gate": "model-00001-of-00005.safetensors",
406
+ "vision_model.gated_positional_embedding.tile_embedding.weight": "model-00001-of-00005.safetensors",
407
+ "vision_model.global_transformer.layers.0.gate_attn": "model-00001-of-00005.safetensors",
408
+ "vision_model.global_transformer.layers.0.gate_ffn": "model-00001-of-00005.safetensors",
409
+ "vision_model.global_transformer.layers.0.input_layernorm.bias": "model-00001-of-00005.safetensors",
410
+ "vision_model.global_transformer.layers.0.input_layernorm.weight": "model-00001-of-00005.safetensors",
411
+ "vision_model.global_transformer.layers.0.mlp.fc1.bias": "model-00001-of-00005.safetensors",
412
+ "vision_model.global_transformer.layers.0.mlp.fc1.weight": "model-00001-of-00005.safetensors",
413
+ "vision_model.global_transformer.layers.0.mlp.fc2.bias": "model-00001-of-00005.safetensors",
414
+ "vision_model.global_transformer.layers.0.mlp.fc2.weight": "model-00001-of-00005.safetensors",
415
+ "vision_model.global_transformer.layers.0.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
416
+ "vision_model.global_transformer.layers.0.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
417
+ "vision_model.global_transformer.layers.0.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
418
+ "vision_model.global_transformer.layers.0.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
419
+ "vision_model.global_transformer.layers.0.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
420
+ "vision_model.global_transformer.layers.0.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
421
+ "vision_model.global_transformer.layers.1.gate_attn": "model-00001-of-00005.safetensors",
422
+ "vision_model.global_transformer.layers.1.gate_ffn": "model-00001-of-00005.safetensors",
423
+ "vision_model.global_transformer.layers.1.input_layernorm.bias": "model-00001-of-00005.safetensors",
424
+ "vision_model.global_transformer.layers.1.input_layernorm.weight": "model-00001-of-00005.safetensors",
425
+ "vision_model.global_transformer.layers.1.mlp.fc1.bias": "model-00001-of-00005.safetensors",
426
+ "vision_model.global_transformer.layers.1.mlp.fc1.weight": "model-00001-of-00005.safetensors",
427
+ "vision_model.global_transformer.layers.1.mlp.fc2.bias": "model-00001-of-00005.safetensors",
428
+ "vision_model.global_transformer.layers.1.mlp.fc2.weight": "model-00001-of-00005.safetensors",
429
+ "vision_model.global_transformer.layers.1.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
430
+ "vision_model.global_transformer.layers.1.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
431
+ "vision_model.global_transformer.layers.1.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
432
+ "vision_model.global_transformer.layers.1.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
433
+ "vision_model.global_transformer.layers.1.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
434
+ "vision_model.global_transformer.layers.1.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
435
+ "vision_model.global_transformer.layers.2.gate_attn": "model-00001-of-00005.safetensors",
436
+ "vision_model.global_transformer.layers.2.gate_ffn": "model-00001-of-00005.safetensors",
437
+ "vision_model.global_transformer.layers.2.input_layernorm.bias": "model-00001-of-00005.safetensors",
438
+ "vision_model.global_transformer.layers.2.input_layernorm.weight": "model-00001-of-00005.safetensors",
439
+ "vision_model.global_transformer.layers.2.mlp.fc1.bias": "model-00001-of-00005.safetensors",
440
+ "vision_model.global_transformer.layers.2.mlp.fc1.weight": "model-00001-of-00005.safetensors",
441
+ "vision_model.global_transformer.layers.2.mlp.fc2.bias": "model-00001-of-00005.safetensors",
442
+ "vision_model.global_transformer.layers.2.mlp.fc2.weight": "model-00001-of-00005.safetensors",
443
+ "vision_model.global_transformer.layers.2.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
444
+ "vision_model.global_transformer.layers.2.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
445
+ "vision_model.global_transformer.layers.2.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
446
+ "vision_model.global_transformer.layers.2.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
447
+ "vision_model.global_transformer.layers.2.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
448
+ "vision_model.global_transformer.layers.2.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
449
+ "vision_model.global_transformer.layers.3.gate_attn": "model-00001-of-00005.safetensors",
450
+ "vision_model.global_transformer.layers.3.gate_ffn": "model-00001-of-00005.safetensors",
451
+ "vision_model.global_transformer.layers.3.input_layernorm.bias": "model-00001-of-00005.safetensors",
452
+ "vision_model.global_transformer.layers.3.input_layernorm.weight": "model-00001-of-00005.safetensors",
453
+ "vision_model.global_transformer.layers.3.mlp.fc1.bias": "model-00001-of-00005.safetensors",
454
+ "vision_model.global_transformer.layers.3.mlp.fc1.weight": "model-00001-of-00005.safetensors",
455
+ "vision_model.global_transformer.layers.3.mlp.fc2.bias": "model-00001-of-00005.safetensors",
456
+ "vision_model.global_transformer.layers.3.mlp.fc2.weight": "model-00001-of-00005.safetensors",
457
+ "vision_model.global_transformer.layers.3.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
458
+ "vision_model.global_transformer.layers.3.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
459
+ "vision_model.global_transformer.layers.3.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
460
+ "vision_model.global_transformer.layers.3.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
461
+ "vision_model.global_transformer.layers.3.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
462
+ "vision_model.global_transformer.layers.3.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
463
+ "vision_model.global_transformer.layers.4.gate_attn": "model-00001-of-00005.safetensors",
464
+ "vision_model.global_transformer.layers.4.gate_ffn": "model-00001-of-00005.safetensors",
465
+ "vision_model.global_transformer.layers.4.input_layernorm.bias": "model-00001-of-00005.safetensors",
466
+ "vision_model.global_transformer.layers.4.input_layernorm.weight": "model-00001-of-00005.safetensors",
467
+ "vision_model.global_transformer.layers.4.mlp.fc1.bias": "model-00001-of-00005.safetensors",
468
+ "vision_model.global_transformer.layers.4.mlp.fc1.weight": "model-00001-of-00005.safetensors",
469
+ "vision_model.global_transformer.layers.4.mlp.fc2.bias": "model-00001-of-00005.safetensors",
470
+ "vision_model.global_transformer.layers.4.mlp.fc2.weight": "model-00001-of-00005.safetensors",
471
+ "vision_model.global_transformer.layers.4.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
472
+ "vision_model.global_transformer.layers.4.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
473
+ "vision_model.global_transformer.layers.4.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
474
+ "vision_model.global_transformer.layers.4.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
475
+ "vision_model.global_transformer.layers.4.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
476
+ "vision_model.global_transformer.layers.4.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
477
+ "vision_model.global_transformer.layers.5.gate_attn": "model-00001-of-00005.safetensors",
478
+ "vision_model.global_transformer.layers.5.gate_ffn": "model-00001-of-00005.safetensors",
479
+ "vision_model.global_transformer.layers.5.input_layernorm.bias": "model-00001-of-00005.safetensors",
480
+ "vision_model.global_transformer.layers.5.input_layernorm.weight": "model-00001-of-00005.safetensors",
481
+ "vision_model.global_transformer.layers.5.mlp.fc1.bias": "model-00001-of-00005.safetensors",
482
+ "vision_model.global_transformer.layers.5.mlp.fc1.weight": "model-00001-of-00005.safetensors",
483
+ "vision_model.global_transformer.layers.5.mlp.fc2.bias": "model-00001-of-00005.safetensors",
484
+ "vision_model.global_transformer.layers.5.mlp.fc2.weight": "model-00001-of-00005.safetensors",
485
+ "vision_model.global_transformer.layers.5.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
486
+ "vision_model.global_transformer.layers.5.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
487
+ "vision_model.global_transformer.layers.5.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
488
+ "vision_model.global_transformer.layers.5.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
489
+ "vision_model.global_transformer.layers.5.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
490
+ "vision_model.global_transformer.layers.5.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
491
+ "vision_model.global_transformer.layers.6.gate_attn": "model-00001-of-00005.safetensors",
492
+ "vision_model.global_transformer.layers.6.gate_ffn": "model-00001-of-00005.safetensors",
493
+ "vision_model.global_transformer.layers.6.input_layernorm.bias": "model-00001-of-00005.safetensors",
494
+ "vision_model.global_transformer.layers.6.input_layernorm.weight": "model-00001-of-00005.safetensors",
495
+ "vision_model.global_transformer.layers.6.mlp.fc1.bias": "model-00001-of-00005.safetensors",
496
+ "vision_model.global_transformer.layers.6.mlp.fc1.weight": "model-00001-of-00005.safetensors",
497
+ "vision_model.global_transformer.layers.6.mlp.fc2.bias": "model-00001-of-00005.safetensors",
498
+ "vision_model.global_transformer.layers.6.mlp.fc2.weight": "model-00001-of-00005.safetensors",
499
+ "vision_model.global_transformer.layers.6.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
500
+ "vision_model.global_transformer.layers.6.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
501
+ "vision_model.global_transformer.layers.6.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
502
+ "vision_model.global_transformer.layers.6.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
503
+ "vision_model.global_transformer.layers.6.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
504
+ "vision_model.global_transformer.layers.6.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
505
+ "vision_model.global_transformer.layers.7.gate_attn": "model-00001-of-00005.safetensors",
506
+ "vision_model.global_transformer.layers.7.gate_ffn": "model-00001-of-00005.safetensors",
507
+ "vision_model.global_transformer.layers.7.input_layernorm.bias": "model-00001-of-00005.safetensors",
508
+ "vision_model.global_transformer.layers.7.input_layernorm.weight": "model-00001-of-00005.safetensors",
509
+ "vision_model.global_transformer.layers.7.mlp.fc1.bias": "model-00001-of-00005.safetensors",
510
+ "vision_model.global_transformer.layers.7.mlp.fc1.weight": "model-00001-of-00005.safetensors",
511
+ "vision_model.global_transformer.layers.7.mlp.fc2.bias": "model-00001-of-00005.safetensors",
512
+ "vision_model.global_transformer.layers.7.mlp.fc2.weight": "model-00001-of-00005.safetensors",
513
+ "vision_model.global_transformer.layers.7.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
514
+ "vision_model.global_transformer.layers.7.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
515
+ "vision_model.global_transformer.layers.7.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
516
+ "vision_model.global_transformer.layers.7.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
517
+ "vision_model.global_transformer.layers.7.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
518
+ "vision_model.global_transformer.layers.7.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
519
+ "vision_model.layernorm_post.bias": "model-00001-of-00005.safetensors",
520
+ "vision_model.layernorm_post.weight": "model-00001-of-00005.safetensors",
521
+ "vision_model.layernorm_pre.bias": "model-00001-of-00005.safetensors",
522
+ "vision_model.layernorm_pre.weight": "model-00001-of-00005.safetensors",
523
+ "vision_model.patch_embedding.weight": "model-00001-of-00005.safetensors",
524
+ "vision_model.post_tile_positional_embedding.embedding.weight": "model-00001-of-00005.safetensors",
525
+ "vision_model.post_tile_positional_embedding.gate": "model-00001-of-00005.safetensors",
526
+ "vision_model.pre_tile_positional_embedding.embedding.weight": "model-00001-of-00005.safetensors",
527
+ "vision_model.pre_tile_positional_embedding.gate": "model-00001-of-00005.safetensors",
528
+ "vision_model.transformer.layers.0.input_layernorm.bias": "model-00001-of-00005.safetensors",
529
+ "vision_model.transformer.layers.0.input_layernorm.weight": "model-00001-of-00005.safetensors",
530
+ "vision_model.transformer.layers.0.mlp.fc1.bias": "model-00001-of-00005.safetensors",
531
+ "vision_model.transformer.layers.0.mlp.fc1.weight": "model-00001-of-00005.safetensors",
532
+ "vision_model.transformer.layers.0.mlp.fc2.bias": "model-00001-of-00005.safetensors",
533
+ "vision_model.transformer.layers.0.mlp.fc2.weight": "model-00001-of-00005.safetensors",
534
+ "vision_model.transformer.layers.0.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
535
+ "vision_model.transformer.layers.0.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
536
+ "vision_model.transformer.layers.0.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
537
+ "vision_model.transformer.layers.0.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
538
+ "vision_model.transformer.layers.0.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
539
+ "vision_model.transformer.layers.0.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
540
+ "vision_model.transformer.layers.1.input_layernorm.bias": "model-00001-of-00005.safetensors",
541
+ "vision_model.transformer.layers.1.input_layernorm.weight": "model-00001-of-00005.safetensors",
542
+ "vision_model.transformer.layers.1.mlp.fc1.bias": "model-00001-of-00005.safetensors",
543
+ "vision_model.transformer.layers.1.mlp.fc1.weight": "model-00001-of-00005.safetensors",
544
+ "vision_model.transformer.layers.1.mlp.fc2.bias": "model-00001-of-00005.safetensors",
545
+ "vision_model.transformer.layers.1.mlp.fc2.weight": "model-00001-of-00005.safetensors",
546
+ "vision_model.transformer.layers.1.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
547
+ "vision_model.transformer.layers.1.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
548
+ "vision_model.transformer.layers.1.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
549
+ "vision_model.transformer.layers.1.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
550
+ "vision_model.transformer.layers.1.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
551
+ "vision_model.transformer.layers.1.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
552
+ "vision_model.transformer.layers.10.input_layernorm.bias": "model-00001-of-00005.safetensors",
553
+ "vision_model.transformer.layers.10.input_layernorm.weight": "model-00001-of-00005.safetensors",
554
+ "vision_model.transformer.layers.10.mlp.fc1.bias": "model-00001-of-00005.safetensors",
555
+ "vision_model.transformer.layers.10.mlp.fc1.weight": "model-00001-of-00005.safetensors",
556
+ "vision_model.transformer.layers.10.mlp.fc2.bias": "model-00001-of-00005.safetensors",
557
+ "vision_model.transformer.layers.10.mlp.fc2.weight": "model-00001-of-00005.safetensors",
558
+ "vision_model.transformer.layers.10.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
559
+ "vision_model.transformer.layers.10.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
560
+ "vision_model.transformer.layers.10.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
561
+ "vision_model.transformer.layers.10.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
562
+ "vision_model.transformer.layers.10.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
563
+ "vision_model.transformer.layers.10.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
564
+ "vision_model.transformer.layers.11.input_layernorm.bias": "model-00001-of-00005.safetensors",
565
+ "vision_model.transformer.layers.11.input_layernorm.weight": "model-00001-of-00005.safetensors",
566
+ "vision_model.transformer.layers.11.mlp.fc1.bias": "model-00001-of-00005.safetensors",
567
+ "vision_model.transformer.layers.11.mlp.fc1.weight": "model-00001-of-00005.safetensors",
568
+ "vision_model.transformer.layers.11.mlp.fc2.bias": "model-00001-of-00005.safetensors",
569
+ "vision_model.transformer.layers.11.mlp.fc2.weight": "model-00001-of-00005.safetensors",
570
+ "vision_model.transformer.layers.11.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
571
+ "vision_model.transformer.layers.11.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
572
+ "vision_model.transformer.layers.11.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
573
+ "vision_model.transformer.layers.11.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
574
+ "vision_model.transformer.layers.11.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
575
+ "vision_model.transformer.layers.11.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
576
+ "vision_model.transformer.layers.12.input_layernorm.bias": "model-00001-of-00005.safetensors",
577
+ "vision_model.transformer.layers.12.input_layernorm.weight": "model-00001-of-00005.safetensors",
578
+ "vision_model.transformer.layers.12.mlp.fc1.bias": "model-00001-of-00005.safetensors",
579
+ "vision_model.transformer.layers.12.mlp.fc1.weight": "model-00001-of-00005.safetensors",
580
+ "vision_model.transformer.layers.12.mlp.fc2.bias": "model-00001-of-00005.safetensors",
581
+ "vision_model.transformer.layers.12.mlp.fc2.weight": "model-00001-of-00005.safetensors",
582
+ "vision_model.transformer.layers.12.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
583
+ "vision_model.transformer.layers.12.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
584
+ "vision_model.transformer.layers.12.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
585
+ "vision_model.transformer.layers.12.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
586
+ "vision_model.transformer.layers.12.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
587
+ "vision_model.transformer.layers.12.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
588
+ "vision_model.transformer.layers.13.input_layernorm.bias": "model-00001-of-00005.safetensors",
589
+ "vision_model.transformer.layers.13.input_layernorm.weight": "model-00001-of-00005.safetensors",
590
+ "vision_model.transformer.layers.13.mlp.fc1.bias": "model-00001-of-00005.safetensors",
591
+ "vision_model.transformer.layers.13.mlp.fc1.weight": "model-00001-of-00005.safetensors",
592
+ "vision_model.transformer.layers.13.mlp.fc2.bias": "model-00001-of-00005.safetensors",
593
+ "vision_model.transformer.layers.13.mlp.fc2.weight": "model-00001-of-00005.safetensors",
594
+ "vision_model.transformer.layers.13.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
595
+ "vision_model.transformer.layers.13.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
596
+ "vision_model.transformer.layers.13.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
597
+ "vision_model.transformer.layers.13.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
598
+ "vision_model.transformer.layers.13.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
599
+ "vision_model.transformer.layers.13.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
600
+ "vision_model.transformer.layers.14.input_layernorm.bias": "model-00001-of-00005.safetensors",
601
+ "vision_model.transformer.layers.14.input_layernorm.weight": "model-00001-of-00005.safetensors",
602
+ "vision_model.transformer.layers.14.mlp.fc1.bias": "model-00001-of-00005.safetensors",
603
+ "vision_model.transformer.layers.14.mlp.fc1.weight": "model-00001-of-00005.safetensors",
604
+ "vision_model.transformer.layers.14.mlp.fc2.bias": "model-00001-of-00005.safetensors",
605
+ "vision_model.transformer.layers.14.mlp.fc2.weight": "model-00001-of-00005.safetensors",
606
+ "vision_model.transformer.layers.14.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
607
+ "vision_model.transformer.layers.14.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
608
+ "vision_model.transformer.layers.14.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
609
+ "vision_model.transformer.layers.14.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
610
+ "vision_model.transformer.layers.14.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
611
+ "vision_model.transformer.layers.14.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
612
+ "vision_model.transformer.layers.15.input_layernorm.bias": "model-00001-of-00005.safetensors",
613
+ "vision_model.transformer.layers.15.input_layernorm.weight": "model-00001-of-00005.safetensors",
614
+ "vision_model.transformer.layers.15.mlp.fc1.bias": "model-00001-of-00005.safetensors",
615
+ "vision_model.transformer.layers.15.mlp.fc1.weight": "model-00001-of-00005.safetensors",
616
+ "vision_model.transformer.layers.15.mlp.fc2.bias": "model-00001-of-00005.safetensors",
617
+ "vision_model.transformer.layers.15.mlp.fc2.weight": "model-00001-of-00005.safetensors",
618
+ "vision_model.transformer.layers.15.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
619
+ "vision_model.transformer.layers.15.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
620
+ "vision_model.transformer.layers.15.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
621
+ "vision_model.transformer.layers.15.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
622
+ "vision_model.transformer.layers.15.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
623
+ "vision_model.transformer.layers.15.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
624
+ "vision_model.transformer.layers.16.input_layernorm.bias": "model-00001-of-00005.safetensors",
625
+ "vision_model.transformer.layers.16.input_layernorm.weight": "model-00001-of-00005.safetensors",
626
+ "vision_model.transformer.layers.16.mlp.fc1.bias": "model-00001-of-00005.safetensors",
627
+ "vision_model.transformer.layers.16.mlp.fc1.weight": "model-00001-of-00005.safetensors",
628
+ "vision_model.transformer.layers.16.mlp.fc2.bias": "model-00001-of-00005.safetensors",
629
+ "vision_model.transformer.layers.16.mlp.fc2.weight": "model-00001-of-00005.safetensors",
630
+ "vision_model.transformer.layers.16.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
631
+ "vision_model.transformer.layers.16.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
632
+ "vision_model.transformer.layers.16.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
633
+ "vision_model.transformer.layers.16.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
634
+ "vision_model.transformer.layers.16.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
635
+ "vision_model.transformer.layers.16.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
636
+ "vision_model.transformer.layers.17.input_layernorm.bias": "model-00001-of-00005.safetensors",
637
+ "vision_model.transformer.layers.17.input_layernorm.weight": "model-00001-of-00005.safetensors",
638
+ "vision_model.transformer.layers.17.mlp.fc1.bias": "model-00001-of-00005.safetensors",
639
+ "vision_model.transformer.layers.17.mlp.fc1.weight": "model-00001-of-00005.safetensors",
640
+ "vision_model.transformer.layers.17.mlp.fc2.bias": "model-00001-of-00005.safetensors",
641
+ "vision_model.transformer.layers.17.mlp.fc2.weight": "model-00001-of-00005.safetensors",
642
+ "vision_model.transformer.layers.17.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
643
+ "vision_model.transformer.layers.17.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
644
+ "vision_model.transformer.layers.17.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
645
+ "vision_model.transformer.layers.17.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
646
+ "vision_model.transformer.layers.17.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
647
+ "vision_model.transformer.layers.17.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
648
+ "vision_model.transformer.layers.18.input_layernorm.bias": "model-00001-of-00005.safetensors",
649
+ "vision_model.transformer.layers.18.input_layernorm.weight": "model-00001-of-00005.safetensors",
650
+ "vision_model.transformer.layers.18.mlp.fc1.bias": "model-00001-of-00005.safetensors",
651
+ "vision_model.transformer.layers.18.mlp.fc1.weight": "model-00001-of-00005.safetensors",
652
+ "vision_model.transformer.layers.18.mlp.fc2.bias": "model-00001-of-00005.safetensors",
653
+ "vision_model.transformer.layers.18.mlp.fc2.weight": "model-00001-of-00005.safetensors",
654
+ "vision_model.transformer.layers.18.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
655
+ "vision_model.transformer.layers.18.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
656
+ "vision_model.transformer.layers.18.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
657
+ "vision_model.transformer.layers.18.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
658
+ "vision_model.transformer.layers.18.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
659
+ "vision_model.transformer.layers.18.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
660
+ "vision_model.transformer.layers.19.input_layernorm.bias": "model-00001-of-00005.safetensors",
661
+ "vision_model.transformer.layers.19.input_layernorm.weight": "model-00001-of-00005.safetensors",
662
+ "vision_model.transformer.layers.19.mlp.fc1.bias": "model-00001-of-00005.safetensors",
663
+ "vision_model.transformer.layers.19.mlp.fc1.weight": "model-00001-of-00005.safetensors",
664
+ "vision_model.transformer.layers.19.mlp.fc2.bias": "model-00001-of-00005.safetensors",
665
+ "vision_model.transformer.layers.19.mlp.fc2.weight": "model-00001-of-00005.safetensors",
666
+ "vision_model.transformer.layers.19.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
667
+ "vision_model.transformer.layers.19.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
668
+ "vision_model.transformer.layers.19.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
669
+ "vision_model.transformer.layers.19.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
670
+ "vision_model.transformer.layers.19.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
671
+ "vision_model.transformer.layers.19.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
672
+ "vision_model.transformer.layers.2.input_layernorm.bias": "model-00001-of-00005.safetensors",
673
+ "vision_model.transformer.layers.2.input_layernorm.weight": "model-00001-of-00005.safetensors",
674
+ "vision_model.transformer.layers.2.mlp.fc1.bias": "model-00001-of-00005.safetensors",
675
+ "vision_model.transformer.layers.2.mlp.fc1.weight": "model-00001-of-00005.safetensors",
676
+ "vision_model.transformer.layers.2.mlp.fc2.bias": "model-00001-of-00005.safetensors",
677
+ "vision_model.transformer.layers.2.mlp.fc2.weight": "model-00001-of-00005.safetensors",
678
+ "vision_model.transformer.layers.2.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
679
+ "vision_model.transformer.layers.2.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
680
+ "vision_model.transformer.layers.2.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
681
+ "vision_model.transformer.layers.2.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
682
+ "vision_model.transformer.layers.2.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
683
+ "vision_model.transformer.layers.2.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
684
+ "vision_model.transformer.layers.20.input_layernorm.bias": "model-00001-of-00005.safetensors",
685
+ "vision_model.transformer.layers.20.input_layernorm.weight": "model-00001-of-00005.safetensors",
686
+ "vision_model.transformer.layers.20.mlp.fc1.bias": "model-00001-of-00005.safetensors",
687
+ "vision_model.transformer.layers.20.mlp.fc1.weight": "model-00001-of-00005.safetensors",
688
+ "vision_model.transformer.layers.20.mlp.fc2.bias": "model-00001-of-00005.safetensors",
689
+ "vision_model.transformer.layers.20.mlp.fc2.weight": "model-00001-of-00005.safetensors",
690
+ "vision_model.transformer.layers.20.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
691
+ "vision_model.transformer.layers.20.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
692
+ "vision_model.transformer.layers.20.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
693
+ "vision_model.transformer.layers.20.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
694
+ "vision_model.transformer.layers.20.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
695
+ "vision_model.transformer.layers.20.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
696
+ "vision_model.transformer.layers.21.input_layernorm.bias": "model-00001-of-00005.safetensors",
697
+ "vision_model.transformer.layers.21.input_layernorm.weight": "model-00001-of-00005.safetensors",
698
+ "vision_model.transformer.layers.21.mlp.fc1.bias": "model-00001-of-00005.safetensors",
699
+ "vision_model.transformer.layers.21.mlp.fc1.weight": "model-00001-of-00005.safetensors",
700
+ "vision_model.transformer.layers.21.mlp.fc2.bias": "model-00001-of-00005.safetensors",
701
+ "vision_model.transformer.layers.21.mlp.fc2.weight": "model-00001-of-00005.safetensors",
702
+ "vision_model.transformer.layers.21.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
703
+ "vision_model.transformer.layers.21.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
704
+ "vision_model.transformer.layers.21.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
705
+ "vision_model.transformer.layers.21.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
706
+ "vision_model.transformer.layers.21.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
707
+ "vision_model.transformer.layers.21.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
708
+ "vision_model.transformer.layers.22.input_layernorm.bias": "model-00001-of-00005.safetensors",
709
+ "vision_model.transformer.layers.22.input_layernorm.weight": "model-00001-of-00005.safetensors",
710
+ "vision_model.transformer.layers.22.mlp.fc1.bias": "model-00001-of-00005.safetensors",
711
+ "vision_model.transformer.layers.22.mlp.fc1.weight": "model-00001-of-00005.safetensors",
712
+ "vision_model.transformer.layers.22.mlp.fc2.bias": "model-00001-of-00005.safetensors",
713
+ "vision_model.transformer.layers.22.mlp.fc2.weight": "model-00001-of-00005.safetensors",
714
+ "vision_model.transformer.layers.22.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
715
+ "vision_model.transformer.layers.22.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
716
+ "vision_model.transformer.layers.22.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
717
+ "vision_model.transformer.layers.22.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
718
+ "vision_model.transformer.layers.22.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
719
+ "vision_model.transformer.layers.22.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
720
+ "vision_model.transformer.layers.23.input_layernorm.bias": "model-00001-of-00005.safetensors",
721
+ "vision_model.transformer.layers.23.input_layernorm.weight": "model-00001-of-00005.safetensors",
722
+ "vision_model.transformer.layers.23.mlp.fc1.bias": "model-00001-of-00005.safetensors",
723
+ "vision_model.transformer.layers.23.mlp.fc1.weight": "model-00001-of-00005.safetensors",
724
+ "vision_model.transformer.layers.23.mlp.fc2.bias": "model-00001-of-00005.safetensors",
725
+ "vision_model.transformer.layers.23.mlp.fc2.weight": "model-00001-of-00005.safetensors",
726
+ "vision_model.transformer.layers.23.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
727
+ "vision_model.transformer.layers.23.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
728
+ "vision_model.transformer.layers.23.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
729
+ "vision_model.transformer.layers.23.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
730
+ "vision_model.transformer.layers.23.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
731
+ "vision_model.transformer.layers.23.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
732
+ "vision_model.transformer.layers.24.input_layernorm.bias": "model-00001-of-00005.safetensors",
733
+ "vision_model.transformer.layers.24.input_layernorm.weight": "model-00001-of-00005.safetensors",
734
+ "vision_model.transformer.layers.24.mlp.fc1.bias": "model-00001-of-00005.safetensors",
735
+ "vision_model.transformer.layers.24.mlp.fc1.weight": "model-00001-of-00005.safetensors",
736
+ "vision_model.transformer.layers.24.mlp.fc2.bias": "model-00001-of-00005.safetensors",
737
+ "vision_model.transformer.layers.24.mlp.fc2.weight": "model-00001-of-00005.safetensors",
738
+ "vision_model.transformer.layers.24.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
739
+ "vision_model.transformer.layers.24.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
740
+ "vision_model.transformer.layers.24.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
741
+ "vision_model.transformer.layers.24.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
742
+ "vision_model.transformer.layers.24.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
743
+ "vision_model.transformer.layers.24.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
744
+ "vision_model.transformer.layers.25.input_layernorm.bias": "model-00001-of-00005.safetensors",
745
+ "vision_model.transformer.layers.25.input_layernorm.weight": "model-00001-of-00005.safetensors",
746
+ "vision_model.transformer.layers.25.mlp.fc1.bias": "model-00001-of-00005.safetensors",
747
+ "vision_model.transformer.layers.25.mlp.fc1.weight": "model-00001-of-00005.safetensors",
748
+ "vision_model.transformer.layers.25.mlp.fc2.bias": "model-00001-of-00005.safetensors",
749
+ "vision_model.transformer.layers.25.mlp.fc2.weight": "model-00001-of-00005.safetensors",
750
+ "vision_model.transformer.layers.25.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
751
+ "vision_model.transformer.layers.25.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
752
+ "vision_model.transformer.layers.25.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
753
+ "vision_model.transformer.layers.25.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
754
+ "vision_model.transformer.layers.25.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
755
+ "vision_model.transformer.layers.25.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
756
+ "vision_model.transformer.layers.26.input_layernorm.bias": "model-00001-of-00005.safetensors",
757
+ "vision_model.transformer.layers.26.input_layernorm.weight": "model-00001-of-00005.safetensors",
758
+ "vision_model.transformer.layers.26.mlp.fc1.bias": "model-00001-of-00005.safetensors",
759
+ "vision_model.transformer.layers.26.mlp.fc1.weight": "model-00001-of-00005.safetensors",
760
+ "vision_model.transformer.layers.26.mlp.fc2.bias": "model-00001-of-00005.safetensors",
761
+ "vision_model.transformer.layers.26.mlp.fc2.weight": "model-00001-of-00005.safetensors",
762
+ "vision_model.transformer.layers.26.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
763
+ "vision_model.transformer.layers.26.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
764
+ "vision_model.transformer.layers.26.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
765
+ "vision_model.transformer.layers.26.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
766
+ "vision_model.transformer.layers.26.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
767
+ "vision_model.transformer.layers.26.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
768
+ "vision_model.transformer.layers.27.input_layernorm.bias": "model-00001-of-00005.safetensors",
769
+ "vision_model.transformer.layers.27.input_layernorm.weight": "model-00001-of-00005.safetensors",
770
+ "vision_model.transformer.layers.27.mlp.fc1.bias": "model-00001-of-00005.safetensors",
771
+ "vision_model.transformer.layers.27.mlp.fc1.weight": "model-00001-of-00005.safetensors",
772
+ "vision_model.transformer.layers.27.mlp.fc2.bias": "model-00001-of-00005.safetensors",
773
+ "vision_model.transformer.layers.27.mlp.fc2.weight": "model-00001-of-00005.safetensors",
774
+ "vision_model.transformer.layers.27.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
775
+ "vision_model.transformer.layers.27.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
776
+ "vision_model.transformer.layers.27.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
777
+ "vision_model.transformer.layers.27.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
778
+ "vision_model.transformer.layers.27.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
779
+ "vision_model.transformer.layers.27.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
780
+ "vision_model.transformer.layers.28.input_layernorm.bias": "model-00001-of-00005.safetensors",
781
+ "vision_model.transformer.layers.28.input_layernorm.weight": "model-00001-of-00005.safetensors",
782
+ "vision_model.transformer.layers.28.mlp.fc1.bias": "model-00001-of-00005.safetensors",
783
+ "vision_model.transformer.layers.28.mlp.fc1.weight": "model-00001-of-00005.safetensors",
784
+ "vision_model.transformer.layers.28.mlp.fc2.bias": "model-00001-of-00005.safetensors",
785
+ "vision_model.transformer.layers.28.mlp.fc2.weight": "model-00001-of-00005.safetensors",
786
+ "vision_model.transformer.layers.28.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
787
+ "vision_model.transformer.layers.28.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
788
+ "vision_model.transformer.layers.28.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
789
+ "vision_model.transformer.layers.28.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
790
+ "vision_model.transformer.layers.28.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
791
+ "vision_model.transformer.layers.28.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
792
+ "vision_model.transformer.layers.29.input_layernorm.bias": "model-00001-of-00005.safetensors",
793
+ "vision_model.transformer.layers.29.input_layernorm.weight": "model-00001-of-00005.safetensors",
794
+ "vision_model.transformer.layers.29.mlp.fc1.bias": "model-00001-of-00005.safetensors",
795
+ "vision_model.transformer.layers.29.mlp.fc1.weight": "model-00001-of-00005.safetensors",
796
+ "vision_model.transformer.layers.29.mlp.fc2.bias": "model-00001-of-00005.safetensors",
797
+ "vision_model.transformer.layers.29.mlp.fc2.weight": "model-00001-of-00005.safetensors",
798
+ "vision_model.transformer.layers.29.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
799
+ "vision_model.transformer.layers.29.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
800
+ "vision_model.transformer.layers.29.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
801
+ "vision_model.transformer.layers.29.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
802
+ "vision_model.transformer.layers.29.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
803
+ "vision_model.transformer.layers.29.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
804
+ "vision_model.transformer.layers.3.input_layernorm.bias": "model-00001-of-00005.safetensors",
805
+ "vision_model.transformer.layers.3.input_layernorm.weight": "model-00001-of-00005.safetensors",
806
+ "vision_model.transformer.layers.3.mlp.fc1.bias": "model-00001-of-00005.safetensors",
807
+ "vision_model.transformer.layers.3.mlp.fc1.weight": "model-00001-of-00005.safetensors",
808
+ "vision_model.transformer.layers.3.mlp.fc2.bias": "model-00001-of-00005.safetensors",
809
+ "vision_model.transformer.layers.3.mlp.fc2.weight": "model-00001-of-00005.safetensors",
810
+ "vision_model.transformer.layers.3.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
811
+ "vision_model.transformer.layers.3.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
812
+ "vision_model.transformer.layers.3.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
813
+ "vision_model.transformer.layers.3.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
814
+ "vision_model.transformer.layers.3.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
815
+ "vision_model.transformer.layers.3.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
816
+ "vision_model.transformer.layers.30.input_layernorm.bias": "model-00001-of-00005.safetensors",
817
+ "vision_model.transformer.layers.30.input_layernorm.weight": "model-00001-of-00005.safetensors",
818
+ "vision_model.transformer.layers.30.mlp.fc1.bias": "model-00001-of-00005.safetensors",
819
+ "vision_model.transformer.layers.30.mlp.fc1.weight": "model-00001-of-00005.safetensors",
820
+ "vision_model.transformer.layers.30.mlp.fc2.bias": "model-00001-of-00005.safetensors",
821
+ "vision_model.transformer.layers.30.mlp.fc2.weight": "model-00001-of-00005.safetensors",
822
+ "vision_model.transformer.layers.30.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
823
+ "vision_model.transformer.layers.30.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
824
+ "vision_model.transformer.layers.30.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
825
+ "vision_model.transformer.layers.30.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
826
+ "vision_model.transformer.layers.30.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
827
+ "vision_model.transformer.layers.30.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
828
+ "vision_model.transformer.layers.31.input_layernorm.bias": "model-00001-of-00005.safetensors",
829
+ "vision_model.transformer.layers.31.input_layernorm.weight": "model-00001-of-00005.safetensors",
830
+ "vision_model.transformer.layers.31.mlp.fc1.bias": "model-00001-of-00005.safetensors",
831
+ "vision_model.transformer.layers.31.mlp.fc1.weight": "model-00001-of-00005.safetensors",
832
+ "vision_model.transformer.layers.31.mlp.fc2.bias": "model-00001-of-00005.safetensors",
833
+ "vision_model.transformer.layers.31.mlp.fc2.weight": "model-00001-of-00005.safetensors",
834
+ "vision_model.transformer.layers.31.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
835
+ "vision_model.transformer.layers.31.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
836
+ "vision_model.transformer.layers.31.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
837
+ "vision_model.transformer.layers.31.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
838
+ "vision_model.transformer.layers.31.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
839
+ "vision_model.transformer.layers.31.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
840
+ "vision_model.transformer.layers.4.input_layernorm.bias": "model-00001-of-00005.safetensors",
841
+ "vision_model.transformer.layers.4.input_layernorm.weight": "model-00001-of-00005.safetensors",
842
+ "vision_model.transformer.layers.4.mlp.fc1.bias": "model-00001-of-00005.safetensors",
843
+ "vision_model.transformer.layers.4.mlp.fc1.weight": "model-00001-of-00005.safetensors",
844
+ "vision_model.transformer.layers.4.mlp.fc2.bias": "model-00001-of-00005.safetensors",
845
+ "vision_model.transformer.layers.4.mlp.fc2.weight": "model-00001-of-00005.safetensors",
846
+ "vision_model.transformer.layers.4.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
847
+ "vision_model.transformer.layers.4.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
848
+ "vision_model.transformer.layers.4.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
849
+ "vision_model.transformer.layers.4.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
850
+ "vision_model.transformer.layers.4.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
851
+ "vision_model.transformer.layers.4.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
852
+ "vision_model.transformer.layers.5.input_layernorm.bias": "model-00001-of-00005.safetensors",
853
+ "vision_model.transformer.layers.5.input_layernorm.weight": "model-00001-of-00005.safetensors",
854
+ "vision_model.transformer.layers.5.mlp.fc1.bias": "model-00001-of-00005.safetensors",
855
+ "vision_model.transformer.layers.5.mlp.fc1.weight": "model-00001-of-00005.safetensors",
856
+ "vision_model.transformer.layers.5.mlp.fc2.bias": "model-00001-of-00005.safetensors",
857
+ "vision_model.transformer.layers.5.mlp.fc2.weight": "model-00001-of-00005.safetensors",
858
+ "vision_model.transformer.layers.5.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
859
+ "vision_model.transformer.layers.5.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
860
+ "vision_model.transformer.layers.5.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
861
+ "vision_model.transformer.layers.5.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
862
+ "vision_model.transformer.layers.5.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
863
+ "vision_model.transformer.layers.5.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
864
+ "vision_model.transformer.layers.6.input_layernorm.bias": "model-00001-of-00005.safetensors",
865
+ "vision_model.transformer.layers.6.input_layernorm.weight": "model-00001-of-00005.safetensors",
866
+ "vision_model.transformer.layers.6.mlp.fc1.bias": "model-00001-of-00005.safetensors",
867
+ "vision_model.transformer.layers.6.mlp.fc1.weight": "model-00001-of-00005.safetensors",
868
+ "vision_model.transformer.layers.6.mlp.fc2.bias": "model-00001-of-00005.safetensors",
869
+ "vision_model.transformer.layers.6.mlp.fc2.weight": "model-00001-of-00005.safetensors",
870
+ "vision_model.transformer.layers.6.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
871
+ "vision_model.transformer.layers.6.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
872
+ "vision_model.transformer.layers.6.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
873
+ "vision_model.transformer.layers.6.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
874
+ "vision_model.transformer.layers.6.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
875
+ "vision_model.transformer.layers.6.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
876
+ "vision_model.transformer.layers.7.input_layernorm.bias": "model-00001-of-00005.safetensors",
877
+ "vision_model.transformer.layers.7.input_layernorm.weight": "model-00001-of-00005.safetensors",
878
+ "vision_model.transformer.layers.7.mlp.fc1.bias": "model-00001-of-00005.safetensors",
879
+ "vision_model.transformer.layers.7.mlp.fc1.weight": "model-00001-of-00005.safetensors",
880
+ "vision_model.transformer.layers.7.mlp.fc2.bias": "model-00001-of-00005.safetensors",
881
+ "vision_model.transformer.layers.7.mlp.fc2.weight": "model-00001-of-00005.safetensors",
882
+ "vision_model.transformer.layers.7.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
883
+ "vision_model.transformer.layers.7.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
884
+ "vision_model.transformer.layers.7.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
885
+ "vision_model.transformer.layers.7.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
886
+ "vision_model.transformer.layers.7.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
887
+ "vision_model.transformer.layers.7.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
888
+ "vision_model.transformer.layers.8.input_layernorm.bias": "model-00001-of-00005.safetensors",
889
+ "vision_model.transformer.layers.8.input_layernorm.weight": "model-00001-of-00005.safetensors",
890
+ "vision_model.transformer.layers.8.mlp.fc1.bias": "model-00001-of-00005.safetensors",
891
+ "vision_model.transformer.layers.8.mlp.fc1.weight": "model-00001-of-00005.safetensors",
892
+ "vision_model.transformer.layers.8.mlp.fc2.bias": "model-00001-of-00005.safetensors",
893
+ "vision_model.transformer.layers.8.mlp.fc2.weight": "model-00001-of-00005.safetensors",
894
+ "vision_model.transformer.layers.8.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
895
+ "vision_model.transformer.layers.8.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
896
+ "vision_model.transformer.layers.8.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
897
+ "vision_model.transformer.layers.8.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
898
+ "vision_model.transformer.layers.8.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
899
+ "vision_model.transformer.layers.8.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
900
+ "vision_model.transformer.layers.9.input_layernorm.bias": "model-00001-of-00005.safetensors",
901
+ "vision_model.transformer.layers.9.input_layernorm.weight": "model-00001-of-00005.safetensors",
902
+ "vision_model.transformer.layers.9.mlp.fc1.bias": "model-00001-of-00005.safetensors",
903
+ "vision_model.transformer.layers.9.mlp.fc1.weight": "model-00001-of-00005.safetensors",
904
+ "vision_model.transformer.layers.9.mlp.fc2.bias": "model-00001-of-00005.safetensors",
905
+ "vision_model.transformer.layers.9.mlp.fc2.weight": "model-00001-of-00005.safetensors",
906
+ "vision_model.transformer.layers.9.post_attention_layernorm.bias": "model-00001-of-00005.safetensors",
907
+ "vision_model.transformer.layers.9.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
908
+ "vision_model.transformer.layers.9.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
909
+ "vision_model.transformer.layers.9.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
910
+ "vision_model.transformer.layers.9.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
911
+ "vision_model.transformer.layers.9.self_attn.v_proj.weight": "model-00001-of-00005.safetensors"
912
+ }
913
+ }
modeling_video_mllama.py ADDED
The diff for this file is too large to render. See raw diff
 
preprocessor_config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoImageProcessor": "image_processing_video_mllama.VideoMllamaImageProcessor",
4
+ "AutoProcessor": "processing_video_mllama.VideoMllamaProcessor"
5
+ },
6
+ "do_convert_rgb": true,
7
+ "do_normalize": true,
8
+ "do_pad": 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": "VideoMllamaImageProcessor",
17
+ "image_std": [
18
+ 0.26862954,
19
+ 0.26130258,
20
+ 0.27577711
21
+ ],
22
+ "max_image_tiles": 1,
23
+ "resample": 2,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "size": {
26
+ "height": 560,
27
+ "width": 560
28
+ },
29
+ "video_fps": 1.0,
30
+ "video_minlen": 8,
31
+ "video_maxlen": 256,
32
+ "frame_extract_num_threads": 4,
33
+ "extract_frame_func": "cv2"
34
+ }
processing_video_mllama.py ADDED
@@ -0,0 +1,836 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2024 The HuggingFace Inc. team.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ """Processor class for VideoMllama."""
17
+
18
+ import av
19
+ import cv2
20
+ import math
21
+ import numpy as np
22
+ import concurrent.futures
23
+
24
+ from PIL import Image
25
+ from typing import List, Optional, Union, Tuple
26
+
27
+ from transformers.feature_extraction_utils import BatchFeature
28
+ from transformers.image_utils import ImageInput, to_numpy_array
29
+ from transformers.processing_utils import ImagesKwargs, ProcessingKwargs, ProcessorMixin, Unpack
30
+ from transformers.tokenization_utils_base import (
31
+ PreTokenizedInput,
32
+ TextInput,
33
+ )
34
+
35
+ from .image_processing_video_mllama import make_list_of_images
36
+
37
+
38
+
39
+
40
+
41
+ class VideoMllamaImagesKwargs(ImagesKwargs, total=False):
42
+ max_image_tiles: Optional[int]
43
+
44
+
45
+ class VideoMllamaProcessorKwargs(ProcessingKwargs, total=False):
46
+ images_kwargs: VideoMllamaImagesKwargs
47
+ add_video_position_encoding: Optional[bool]
48
+
49
+ _defaults = {
50
+ "image_kwargs": {
51
+ "max_image_tiles": 1,
52
+ },
53
+ "add_video_position_encoding": True,
54
+ }
55
+
56
+
57
+ # --- Start of new video sampling functions (adapted from streaming/mm_plugin.py) ---
58
+
59
+
60
+ def validate_frame_sampling(sample_indices, frames, max_missing_frames=2, max_missing_ratio=0.1):
61
+ """
62
+ Validate the completeness of sampled frames.
63
+ """
64
+ expected_count = len(sample_indices)
65
+ actual_count = len(frames)
66
+ missing_count = expected_count - actual_count
67
+
68
+ if missing_count <= 0:
69
+ return
70
+
71
+ missing_ratio = missing_count / expected_count
72
+
73
+ if missing_count > max_missing_frames and missing_ratio > max_missing_ratio:
74
+ raise ValueError(
75
+ f"Too many frames missing: {missing_count}/{expected_count} "
76
+ f"({missing_ratio:.1%}) frames missing, exceeding "
77
+ f"{max_missing_ratio:.0%} threshold."
78
+ )
79
+
80
+
81
+ def _get_video_sample_frames(video_stream, total_frames: int = 0, **kwargs) -> np.ndarray:
82
+ """
83
+ Core logic to compute video sample frame indices.
84
+ """
85
+ video_fps: float = kwargs.get("video_fps", 1.0)
86
+ video_minlen: int = kwargs.get("video_minlen", 8)
87
+ video_maxlen: int = kwargs.get("video_maxlen", 256)
88
+
89
+ obtained_total_frames = int(video_stream.frames)
90
+
91
+ duration = float(video_stream.duration * video_stream.time_base)
92
+ frame_rate = float(video_stream.average_rate)
93
+ calculated_total_frames = round(duration * frame_rate)
94
+ assert video_fps <= frame_rate, f"Sampling frequency ({video_fps}) must be less than or equal to video frame rate ({frame_rate})"
95
+
96
+ total_frames_num = [x for x in [total_frames, obtained_total_frames, calculated_total_frames] if x > 0]
97
+ final_total_frames = min(total_frames_num) if total_frames_num else 0
98
+ if final_total_frames == 0:
99
+ raise AttributeError("Unable to obtain or calculate the total number of frames in the video.")
100
+
101
+ target_total_frames = int(math.ceil(duration * video_fps - 1e-6))
102
+ sample_frames = max(target_total_frames, video_minlen)
103
+ sample_frames = min(sample_frames, video_maxlen, final_total_frames)
104
+
105
+ if target_total_frames == sample_frames and video_fps > 0 and frame_rate > 0:
106
+ sample_indices = np.arange(target_total_frames, dtype=np.int32)
107
+ sample_indices = (sample_indices * frame_rate / video_fps).astype(np.int32)
108
+ else:
109
+ sample_indices = np.linspace(0, final_total_frames - 1, sample_frames).astype(np.int32)
110
+
111
+ return sample_indices
112
+
113
+
114
+ def _get_cv2_video_sample_frames(video_path: str, total_frames: int = 0, **kwargs) -> np.ndarray:
115
+ container = av.open(video_path, "r")
116
+ video_stream = next(stream for stream in container.streams if stream.type == "video")
117
+ sample_indices = _get_video_sample_frames(video_stream, total_frames=total_frames, **kwargs)
118
+ return sample_indices
119
+
120
+
121
+ def get_video_sample_frames_av(video_path: str, **kwargs) -> List[Image.Image]:
122
+ container = av.open(video_path, "r")
123
+ video_stream = next(stream for stream in container.streams if stream.type == "video")
124
+
125
+ sample_indices = _get_video_sample_frames(video_stream, **kwargs)
126
+ sample_indices_set = set(sample_indices)
127
+
128
+ frames: List[Image.Image] = []
129
+
130
+ container.seek(0)
131
+ for frame_idx, frame in enumerate(container.decode(video_stream)):
132
+ if frame_idx in sample_indices_set:
133
+ frames.append(frame.to_image())
134
+ if len(frames) == len(sample_indices):
135
+ break
136
+
137
+ validate_frame_sampling(sample_indices, frames)
138
+
139
+ return frames
140
+
141
+
142
+ def get_cv2_video_sample_frames_multithread(video_path: str, **kwargs) -> List[Image.Image]:
143
+ num_threads: int = kwargs.get("frame_extract_num_threads", 4)
144
+ num_threads = int(num_threads)
145
+
146
+ cap = cv2.VideoCapture(video_path)
147
+ if not cap.isOpened():
148
+ raise ValueError(f"Unable to open video file: {video_path}")
149
+
150
+ total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
151
+ cap.release()
152
+
153
+ frame_indices = _get_cv2_video_sample_frames(video_path, total_frames=total_frames, **kwargs)
154
+
155
+ unique_frames: List[Optional[np.ndarray]] = [None] * len(frame_indices)
156
+ index_map = {idx: pos for pos, idx in enumerate(frame_indices)}
157
+
158
+ chunks = np.array_split(frame_indices, min(num_threads, len(frame_indices)))
159
+
160
+ def worker(chunk_indices):
161
+ local_cap = cv2.VideoCapture(video_path)
162
+ if not local_cap.isOpened():
163
+ return
164
+
165
+ if chunk_indices[0] > 0:
166
+ local_cap.set(cv2.CAP_PROP_POS_FRAMES, chunk_indices[0])
167
+
168
+ frame_idx_cursor = chunk_indices[0]
169
+ chunk_cursor = 0
170
+
171
+ while chunk_cursor < len(chunk_indices):
172
+ target_idx = chunk_indices[chunk_cursor]
173
+ ok = local_cap.grab()
174
+ if not ok:
175
+ break
176
+
177
+ if frame_idx_cursor == target_idx:
178
+ ret, frame = local_cap.retrieve()
179
+ if ret:
180
+ unique_pos = index_map[target_idx]
181
+ unique_frames[unique_pos] = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
182
+ chunk_cursor += 1
183
+ frame_idx_cursor += 1
184
+ local_cap.release()
185
+
186
+ with concurrent.futures.ThreadPoolExecutor(max_workers=num_threads) as executor:
187
+ list(executor.map(worker, [chunk for chunk in chunks if len(chunk) > 0]))
188
+
189
+ pil_frames = [Image.fromarray(frame) for frame in unique_frames if frame is not None]
190
+
191
+ validate_frame_sampling(frame_indices, pil_frames)
192
+
193
+ if not pil_frames:
194
+ return get_video_sample_frames_av(video_path, **kwargs)
195
+
196
+ return pil_frames
197
+
198
+
199
+ # --- End of new video sampling functions ---
200
+
201
+
202
+ def get_cross_attention_token_mask(
203
+ input_ids: List[int],
204
+ attention_mask: List[int],
205
+ image_token_id: int,
206
+ video_token_id: int,
207
+ frame_num_per_video: List[int],
208
+ cross_attention_token_mask_pad_token_id: int = -100,
209
+ ) -> Tuple[List[int], List[int], List[int]]:
210
+ """
211
+ Generate a cross-attention-token-mask for each input_tokens in the input sequence.
212
+ This function implements a causal attention logic:
213
+ - A text token can see all image tokens that appeared before it.
214
+ - An image token can see itself and all image tokens that appeared before it.
215
+ """
216
+ # 1. Convert video tokens to image tokens
217
+ input_ids_np = np.array(input_ids, dtype=np.int64)
218
+ if video_token_id in input_ids_np:
219
+ total_vid_num = np.sum(input_ids_np == video_token_id)
220
+ f_num_per_vid = frame_num_per_video[:total_vid_num]
221
+
222
+ convert_input_ids_list = []
223
+ convert_attention_mask_list = []
224
+ vid_idx = 0
225
+ for token_id, mask_val in zip(input_ids_np, attention_mask):
226
+ if token_id == video_token_id:
227
+ vid_len = f_num_per_vid[vid_idx]
228
+ vid_idx += 1
229
+ convert_input_ids_list.extend([image_token_id] * vid_len)
230
+ convert_attention_mask_list.extend([mask_val] * vid_len)
231
+ else:
232
+ convert_input_ids_list.append(token_id)
233
+ convert_attention_mask_list.append(mask_val)
234
+ convert_input_ids = np.array(convert_input_ids_list, dtype=np.int64)
235
+ convert_attention_mask = np.array(convert_attention_mask_list, dtype=np.int64)
236
+ else:
237
+ convert_input_ids = input_ids_np
238
+ convert_attention_mask = np.array(attention_mask, dtype=np.int64)
239
+
240
+ # 2. Generate the sparse attention mask based on causal visibility
241
+ is_image = convert_input_ids == image_token_id
242
+ # Cumulative count of images up to and including the current position
243
+ image_count_cumulative = np.cumsum(is_image)
244
+ # Cumulative count of images up to the previous position
245
+ image_count_before = np.pad(image_count_cumulative[:-1], (1, 0), "constant", constant_values=0)
246
+
247
+ # For text tokens, num_seen = image_count_before.
248
+ # For image tokens, num_seen = image_count_cumulative (sees itself).
249
+ num_images_seen = np.where(is_image, image_count_cumulative, image_count_before)
250
+
251
+ # Convert num_seen to sparse mask value (num_seen - 1).
252
+ vision_masks = np.full(len(convert_input_ids), cross_attention_token_mask_pad_token_id, dtype=np.int64)
253
+ valid_mask = num_images_seen > 0
254
+ vision_masks[valid_mask] = num_images_seen[valid_mask] - 1
255
+
256
+ return vision_masks.tolist(), convert_input_ids.tolist(), convert_attention_mask.tolist()
257
+
258
+
259
+ def convert_sparse_cross_attention_mask_to_dense(
260
+ cross_attention_token_masks: np.ndarray,
261
+ num_tiles: List[List[int]],
262
+ max_num_tiles: int,
263
+ cross_attention_token_mask_pad_token_id: int = -100,
264
+ ) -> np.ndarray:
265
+ """
266
+ Convert the cross attention mask indices to a cross attention mask 4D array.
267
+
268
+ This function takes a sparse representation of cross attention masks and converts it to a dense 4D numpy array.
269
+ The sparse representation is a tensor that defines [the range of images that can be seen] for [each input token].
270
+ """
271
+ batch_size, length = cross_attention_token_masks.shape
272
+ max_num_images = max([len(n_tiles) for n_tiles in num_tiles]) if num_tiles else 0
273
+
274
+ cross_attention_mask = np.zeros(
275
+ shape=(batch_size, length, max_num_images, max_num_tiles),
276
+ dtype=np.int64,
277
+ )
278
+
279
+ if max_num_images == 0:
280
+ return cross_attention_mask
281
+
282
+ for batch_idx, (sparse_mask, n_tiles) in enumerate(zip(cross_attention_token_masks, num_tiles)):
283
+ # For each image, find all text tokens that are allowed to see it.
284
+ # A token with sparse_mask value N can see all images with index i <= N.
285
+ for image_idx, mask_n_tiles in enumerate(n_tiles):
286
+ # Find all token positions where the sparse mask value is >= the current image's index.
287
+ # This correctly implements the causal logic.
288
+ visible_token_indices = (sparse_mask >= image_idx) & (sparse_mask != cross_attention_token_mask_pad_token_id)
289
+ # Set the attention mask to 1 for these tokens and the current image.
290
+ cross_attention_mask[batch_idx, visible_token_indices, image_idx, :mask_n_tiles] = 1
291
+
292
+ return cross_attention_mask
293
+
294
+
295
+ def build_string_from_input(prompt: str, bos_token: str, image_token: str, video_token: str) -> str:
296
+ """
297
+ Builds a string from the input prompt by adding `bos_token` if not already present.
298
+ It handles prompts starting with image or video tokens.
299
+ """
300
+
301
+ if bos_token in prompt:
302
+ return prompt
303
+
304
+ num_media_tokens_on_start = 0
305
+ media_tokens = []
306
+
307
+ while prompt.startswith(image_token) or prompt.startswith(video_token):
308
+ if prompt.startswith(image_token):
309
+ prompt = prompt[len(image_token) :]
310
+ media_tokens.append(image_token)
311
+ elif prompt.startswith(video_token):
312
+ prompt = prompt[len(video_token) :]
313
+ media_tokens.append(video_token)
314
+ num_media_tokens_on_start += 1
315
+
316
+ print(f"No bos_token `{bos_token}` in prompt, so it is added after the {num_media_tokens_on_start} media tokens at the start of the prompt.")
317
+
318
+ return f"{''.join(media_tokens)}{bos_token}{prompt}"
319
+
320
+
321
+ VIDEO_MLLAMA_PROCESSOR_PAD_POSITION_ID = 0
322
+ VIDEO_MLLAMA_PROCESSOR_CROSS_ATTENTION_TOKEN_MASK_PAD_TOKEN_ID = -100
323
+
324
+ class VideoMllamaProcessor(ProcessorMixin):
325
+ r"""
326
+ Constructs a VideoMllama processor which wraps [`VideoMllamaImageProcessor`] and
327
+ [`PretrainedTokenizerFast`] into a single processor that inherits both the image processor and
328
+ tokenizer functionalities. See the [`~VideoMllamaProcessor.__call__`] and [`~OwlViTProcessor.decode`] for more
329
+ information.
330
+ The preferred way of passing kwargs is as a dictionary per modality, see usage example below.
331
+ ```python
332
+ from transformers import VideoMllamaProcessor
333
+ from PIL import Image
334
+
335
+ processor = VideoMllamaProcessor.from_pretrained("meta-llama/Llama-3.2-11B-Vision")
336
+
337
+ processor(
338
+ images=your_pil_image,
339
+ text=["<|image|>If I had to write a haiku for this one"],
340
+ images_kwargs = {"size": {"height": 448, "width": 448}},
341
+ text_kwargs = {"padding": "right"},
342
+ common_kwargs = {"return_tensors": "pt"},
343
+ )
344
+ ```
345
+
346
+ Args:
347
+ image_processor ([`VideoMllamaImageProcessor`]):
348
+ The image processor is a required input.
349
+ tokenizer ([`PreTrainedTokenizer`, `PreTrainedTokenizerFast`]):
350
+ The tokenizer is a required input.
351
+
352
+ """
353
+
354
+ attributes = ["image_processor", "tokenizer"]
355
+ image_processor_class = "AutoImageProcessor"
356
+ tokenizer_class = "PreTrainedTokenizerFast"
357
+
358
+ _defaults = {
359
+ "image_kwargs": {
360
+ "max_image_tiles": 1,
361
+ },
362
+ "add_video_position_encoding": True,
363
+ }
364
+
365
+ def __init__(self, image_processor, tokenizer, video_fps = None, video_minlen = None, video_maxlen = None,frame_extract_num_threads = None, extract_frame_func = None, max_image_tiles: Optional[int] = None, **kwargs):
366
+ # User-facing placeholders
367
+ self.image_placeholder = "<image>"
368
+ self.video_placeholder = "<video>"
369
+ self.tokenizer = tokenizer
370
+
371
+ super().__init__(image_processor, tokenizer)
372
+ if max_image_tiles is not None:
373
+ self.image_processor.max_image_tiles = max_image_tiles
374
+
375
+ if not hasattr(self.tokenizer, "image_token"):
376
+ self.image_token = "<|image|>"
377
+ self.image_token_id = self.tokenizer.convert_tokens_to_ids(self.image_token)
378
+ else:
379
+ self.image_token = self.tokenizer.image_token
380
+ self.image_token_id = self.tokenizer.image_token_id
381
+
382
+ if not hasattr(self.tokenizer, "video_token"):
383
+ self.video_token = "<|video|>"
384
+ self.video_token_id = self.tokenizer.convert_tokens_to_ids(self.video_token)
385
+ else:
386
+ self.video_token = self.tokenizer.video_token
387
+ self.video_token_id = self.tokenizer.video_token_id
388
+
389
+ self.add_video_position_encoding = self._defaults["add_video_position_encoding"]
390
+
391
+ self.pad_position_id = VIDEO_MLLAMA_PROCESSOR_PAD_POSITION_ID
392
+ self.cross_attention_token_mask_pad_token_id = VIDEO_MLLAMA_PROCESSOR_CROSS_ATTENTION_TOKEN_MASK_PAD_TOKEN_ID
393
+
394
+ # New configuration for video frame sampling
395
+ if video_fps is None:
396
+ self.video_fps = getattr(image_processor, "video_fps", 1.0)
397
+ if video_minlen is None:
398
+ self.video_minlen = getattr(image_processor, "video_minlen", 8)
399
+ if video_maxlen is None:
400
+ self.video_maxlen = getattr(image_processor, "video_maxlen", 256)
401
+ if frame_extract_num_threads is None:
402
+ self.frame_extract_num_threads = getattr(image_processor, "frame_extract_num_threads", 4)
403
+ if extract_frame_func is None:
404
+ self.extract_frame_func = getattr(image_processor, "extract_frame_func", "cv2") # Options: "av", "cv2"
405
+
406
+ self.bos_token = self.tokenizer.bos_token
407
+ self.chat_template = self.tokenizer.chat_template
408
+
409
+ def _pad_sequences(
410
+ self,
411
+ sequences: List[List[int]],
412
+ pad_value: int,
413
+ max_length: Optional[int] = None,
414
+ padding_side: str = "right",
415
+ pad_to_multiple_of: Optional[int] = None,
416
+ ) -> np.ndarray:
417
+ if not sequences:
418
+ return np.array([], dtype=np.int64)
419
+
420
+ if max_length is None:
421
+ max_length = max(len(seq) for seq in sequences)
422
+
423
+ if pad_to_multiple_of is not None and (max_length % pad_to_multiple_of != 0):
424
+ max_length = ((max_length // pad_to_multiple_of) + 1) * pad_to_multiple_of
425
+
426
+ padded_sequences = np.full((len(sequences), max_length), pad_value, dtype=np.int64)
427
+
428
+ for i, seq in enumerate(sequences):
429
+ length = len(seq)
430
+ if padding_side == "right":
431
+ padded_sequences[i, :length] = seq
432
+ else: # left
433
+ padded_sequences[i, -length:] = seq
434
+ return padded_sequences
435
+
436
+
437
+ def __call__(
438
+ self,
439
+ text: Optional[Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]]] = None,
440
+ images: Optional[Union[ImageInput, str, List[str], List[List[str]]]] = None,
441
+ videos: Optional[Union[str, List[str], List[List[str]]]] = None,
442
+ **kwargs: Unpack[VideoMllamaProcessorKwargs],
443
+ ) -> BatchFeature:
444
+ """
445
+ Main method to prepare text(s), image(s) and video(s) to be fed as input to the model. This method forwards the `text`
446
+ arguments to PreTrainedTokenizerFast's [`~PreTrainedTokenizerFast.__call__`] if `text` is not `None` to encode
447
+ the text. To prepare the image(s), this method forwards the `images` arguments to
448
+ VideoMllamaImageProcessor's [`~VideoMllamaImageProcessor.__call__`] if `images` is not `None`. Videos are first
449
+ processed into frames and then handled as images.
450
+
451
+ Args:
452
+ text (`str`, `List[str]`, `List[List[str]]`):
453
+ The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
454
+ (pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
455
+ `is_split_into_words=True` (to lift the ambiguity with a batch of sequences).
456
+ images (`str`, `PIL.Image.Image`, `np.ndarray`, `torch.Tensor`, `List[str]`, `List[PIL.Image.Image]`, `List[np.ndarray]`, `List[torch.Tensor]`):
457
+ The image or batch of images to be prepared. Can be a single image path, a single PIL image, or a
458
+ list of paths or PIL images. When a list of single images is passed, it's treated as a batch of samples.
459
+ videos (`str`, `List[str]`, `List[List[str]]`):
460
+ The video or batch of videos to be prepared. Can be a single video path, a list of video paths (which
461
+ is treated as a batch), or a list of lists of video paths (already batched).
462
+ return_tensors (`str` or [`~utils.TensorType`], *optional*):
463
+ If set, will return tensors of a particular framework. Acceptable values are:
464
+ - `'tf'`: Return TensorFlow `tf.constant` objects.
465
+ - `'pt'`: Return PyTorch `torch.Tensor` objects.
466
+ - `'np'`: Return NumPy `np.ndarray` objects.
467
+ - `'jax'`: Return JAX `jnp.ndarray` objects.
468
+ Returns:
469
+ [`BatchFeature`]: A [`BatchFeature`] with the following fields:
470
+
471
+ - **input_ids** -- List of token ids to be fed to a model. Returned when `text` is not `None`.
472
+ - **attention_mask** -- List of indices specifying which tokens should be attended to by the model (when
473
+ `return_attention_mask=True` or if *"attention_mask"* is in `self.model_input_names` and if `text` is not
474
+ `None`).
475
+ - **pixel_values** -- Pixel values to be fed to a model. Returned when `images` is not `None`.
476
+ """
477
+ # Step 0: Sanity checks
478
+ # Step 0.1: Convert empty lists to None
479
+ if images is not None and isinstance(images, list) and len(images) == 0:
480
+ images = None
481
+ if videos is not None and isinstance(videos, list) and len(videos) == 0:
482
+ videos = None
483
+
484
+ # Step 0.2: If no text, images, or videos are provided, raise an error
485
+ if text is None and images is None and videos is None:
486
+ raise ValueError("You have to specify either `text`, `images` or `videos`.")
487
+ # Step 0.3: If no text is provided, at least one of images or videos must be present
488
+ if text is None and not (images or videos):
489
+ raise ValueError("If no text is provided, at least one of images or videos must be present.")
490
+
491
+ # Step 1: Pop video-specific kwargs to allow overriding class-level settings
492
+ video_fps = kwargs.pop("video_fps", self.video_fps)
493
+ video_minlen = kwargs.pop("video_minlen", self.video_minlen)
494
+ video_maxlen = kwargs.pop("video_maxlen", self.video_maxlen)
495
+ frame_extract_num_threads = kwargs.pop("frame_extract_num_threads", self.frame_extract_num_threads)
496
+ extract_frame_func = kwargs.pop("extract_frame_func", self.extract_frame_func)
497
+ max_image_tiles = kwargs.pop("max_image_tiles", self.image_processor.max_image_tiles)
498
+
499
+ # Step 2: Standardize inputs
500
+ # Step 2.1: Standardize text
501
+ # Step 2.1.1: If text is a string, convert it to a list of strings
502
+ if text is not None and isinstance(text, str):
503
+ text = [text]
504
+ # Step 2.1.2: Replace user-facing placeholders with tokenizer's special tokens
505
+ if text is not None:
506
+ processed_text: List[str] = []
507
+ for t in text:
508
+ # Can be List[str] or str
509
+ if isinstance(t, str):
510
+ t = t.replace(self.image_placeholder, self.image_token)
511
+ t = t.replace(self.video_placeholder, self.video_token)
512
+ processed_text.append(t)
513
+ text = processed_text
514
+
515
+ # Step 2.2: Normalize images
516
+ # If the input `images` is a string or a list of strings, open them into PIL Images first.
517
+ # Then, let `make_list_of_images` handle the rest.
518
+ loaded_images: Optional[ImageInput] = None
519
+ if images is not None:
520
+ if isinstance(images, str):
521
+ loaded_images = Image.open(images)
522
+ elif isinstance(images, list) and all(isinstance(i, str) for i in images):
523
+ loaded_images = [Image.open(i) for i in images]
524
+ elif isinstance(images, list) and all(isinstance(i, list) for i in images) and all(isinstance(j, str) for i in images for j in i):
525
+ loaded_images = [[Image.open(j) for j in i] for i in images]
526
+ else:
527
+ # If it's already a PIL Image, a list of PIL Images, or other formats, keep it as is.
528
+ loaded_images = images
529
+ images_list = make_list_of_images(loaded_images) if loaded_images is not None else None
530
+
531
+ # Step 2.3: Normalize videos
532
+ # If the input `videos` is a string (video_path), convert it to a list of strings
533
+ videos_list: Optional[List[List[str]]] = None
534
+ if videos is not None:
535
+ if isinstance(videos, str):
536
+ videos_list = [[videos]] # Batch of 1, sample with 1 video
537
+ elif isinstance(videos, list) and all(isinstance(i, str) for i in videos):
538
+ videos_list = [videos] # Batch of 1, sample with multiple videos
539
+ elif isinstance(videos, list) and all(isinstance(i, list) for i in videos) and all(isinstance(j, str) for i in videos for j in i):
540
+ videos_list = videos # Already in correct batch format
541
+ else:
542
+ raise ValueError(f"Invalid video input type: {type(videos)}")
543
+
544
+ # Step 3: Initialize the output kwargs
545
+ # Step 3.1: Initialize the output kwargs with `default values` and `kwargs` provided by the user
546
+ output_kwargs = self._merge_kwargs(
547
+ VideoMllamaProcessorKwargs,
548
+ tokenizer_init_kwargs=self.tokenizer.init_kwargs,
549
+ **kwargs,
550
+ )
551
+ # Step 3.2: Pop the kwargs from the output kwargs to get `common_kwargs`, `text_kwargs`, and `images_kwargs`
552
+ common_kwargs = output_kwargs["common_kwargs"]
553
+ text_kwargs = output_kwargs["text_kwargs"]
554
+ images_kwargs = output_kwargs["images_kwargs"]
555
+
556
+ # [** Final data to be returned **]
557
+ data = {}
558
+
559
+ # Step 4: Text processing
560
+ original_encoding = {}
561
+ if text is not None:
562
+ batch_size = len(text)
563
+ # Step 4.1: Check n_images_in_text and n_videos_in_text to make sure they match the number of images and videos provided
564
+ if images_list is not None and len(images_list) != batch_size:
565
+ raise ValueError(
566
+ f"The number of samples in `text` ({batch_size}) and `images` ({len(images_list)}) do not match."
567
+ )
568
+ if videos_list is not None and len(videos_list) != batch_size:
569
+ raise ValueError(
570
+ f"The number of samples in `text` ({batch_size}) and `videos` ({len(videos_list)}) do not match."
571
+ )
572
+
573
+ n_images_in_text = [t.count(self.image_token) for t in text]
574
+ n_videos_in_text = [t.count(self.video_token) for t in text]
575
+
576
+ # Early validation for media token and provided media counts
577
+ n_images_provided = [len(img) for img in images_list] if images_list else [0] * len(text)
578
+ if any(img1 != img2 for img1, img2 in zip(n_images_in_text, n_images_provided)):
579
+ raise ValueError(
580
+ "Number of image tokens does not match number of images provided. "
581
+ f"Found {n_images_in_text} image tokens and {n_images_provided} images."
582
+ )
583
+
584
+ n_videos_provided = [len(vid) for vid in videos_list] if videos_list else [0] * len(text)
585
+ if any(vid1 != vid2 for vid1, vid2 in zip(n_videos_in_text, n_videos_provided)):
586
+ raise ValueError(
587
+ "Number of video tokens does not match number of videos provided. "
588
+ f"Found {n_videos_in_text} video tokens and {n_videos_provided} videos."
589
+ )
590
+
591
+ # Step 4.2: Build the text to be encoded. Specifically, if `bos_token` not exist, add it to the beginning of the text.
592
+ # text_to_encode = [
593
+ # build_string_from_input(text_item, self.bos_token, self.image_token, self.video_token)
594
+ # for text_item in text
595
+ # ]
596
+
597
+ # Step 4.2: Use the original text instead of the processed text
598
+ text_to_encode = text
599
+ # Step 4.3: Encode the text
600
+ original_encoding = self.tokenizer(text_to_encode, **text_kwargs)
601
+
602
+ # Step 4.4: Update the final data with the processed text encoding
603
+ if original_encoding:
604
+ data.update(original_encoding)
605
+
606
+ # Step 5: Image and Video processing
607
+ # This part handles image and video loading, frame extraction, and ordering.
608
+ batch_media = []
609
+ frame_num_per_video_batch = []
610
+ # Step 5.1: Determine the number of samples to process.
611
+ num_samples = 0
612
+ if text is not None:
613
+ num_samples = len(text)
614
+ else:
615
+ # If text is not provided, determine sample count from the longer of images/videos lists.
616
+ # We've already validated that at least one of them is present.
617
+ num_img_samples = len(images_list) if images_list else 0
618
+ num_vid_samples = len(videos_list) if videos_list else 0
619
+ num_samples = max(num_img_samples, num_vid_samples)
620
+
621
+ # No text provided, process media in default order (images first, then videos).
622
+ print("No text provided, processing media in default order (images first, then videos).")
623
+
624
+ for i in range(num_samples):
625
+ sample_images = images_list[i] if images_list and i < len(images_list) else []
626
+ sample_videos = videos_list[i] if videos_list and i < len(videos_list) else []
627
+
628
+ # Step 5.2: Determine the media order
629
+ media_order = []
630
+ if text is not None:
631
+ # Determine media order from text tokens
632
+ txt = text[i]
633
+ img_tokens_in_text = [(pos, "image") for pos, char in enumerate(txt) if txt.startswith(self.image_token, pos)]
634
+ vid_tokens_in_text = [(pos, "video") for pos, char in enumerate(txt) if txt.startswith(self.video_token, pos)]
635
+ # sort by position and get only the media type
636
+ media_order = [media_type for _, media_type in sorted(img_tokens_in_text + vid_tokens_in_text)]
637
+ else:
638
+ # Default order: all images, then all videos
639
+ media_order.extend(["image"] * len(sample_images))
640
+ media_order.extend(["video"] * len(sample_videos))
641
+
642
+ # Step 5.3: Add images and videos to the batch in the order of `media_order`
643
+ media_for_sample = []
644
+ num_frames_per_video_sample = []
645
+ image_idx = 0
646
+ video_idx = 0
647
+
648
+ for media_type in media_order:
649
+ if media_type == "image":
650
+ media_for_sample.append(sample_images[image_idx])
651
+ image_idx += 1
652
+ elif media_type == "video":
653
+ video_path = sample_videos[video_idx]
654
+
655
+ sampling_kwargs = {
656
+ "video_fps": video_fps,
657
+ "video_minlen": video_minlen,
658
+ "video_maxlen": video_maxlen,
659
+ "frame_extract_num_threads": frame_extract_num_threads,
660
+ }
661
+ try:
662
+ if extract_frame_func == "cv2":
663
+ frames = get_cv2_video_sample_frames_multithread(video_path, **sampling_kwargs)
664
+ else: # "av"
665
+ frames = get_video_sample_frames_av(video_path, **sampling_kwargs)
666
+ except Exception as e:
667
+ raise ValueError(f"This video format is not supported.\nvideo processing failed: {e}")
668
+
669
+ media_for_sample.extend(frames)
670
+ num_frames_per_video_sample.append(len(frames))
671
+ video_idx += 1
672
+
673
+ batch_media.append(media_for_sample)
674
+ frame_num_per_video_batch.append(num_frames_per_video_sample)
675
+
676
+ # Step 5.4: Process images with image_processor
677
+ num_tiles_batch = []
678
+ if any(batch_media):
679
+ images_kwargs["max_image_tiles"] = max_image_tiles
680
+ image_features = self.image_processor(batch_media, **images_kwargs)
681
+ num_tiles_batch = image_features.pop("num_tiles")
682
+ data.update(image_features)
683
+
684
+ # Step 6: Calculate cross attention token masks
685
+ if original_encoding:
686
+ cross_attention_token_masks = []
687
+ final_input_ids = []
688
+ final_attention_mask = []
689
+
690
+ # Step 6.1: Check if the attention mask is provided
691
+ has_attention_mask = "attention_mask" in original_encoding
692
+
693
+ for i, token_ids in enumerate(original_encoding["input_ids"]):
694
+ # Step 6.2: Get the attention mask for the sample
695
+ attention_mask_for_sample = (
696
+ original_encoding["attention_mask"][i] if has_attention_mask else [1] * len(token_ids)
697
+ )
698
+ # Step 6.3: Get the cross attention token masks for the sample
699
+ mask, converted_ids, converted_attn_mask = get_cross_attention_token_mask(
700
+ token_ids,
701
+ attention_mask_for_sample,
702
+ self.image_token_id,
703
+ self.video_token_id,
704
+ frame_num_per_video_batch[i],
705
+ self.cross_attention_token_mask_pad_token_id,
706
+ )
707
+ # Step 6.4: Append the `cross_attention_token_masks`, converted `final_input_ids`, and converted `converted_attn_mask` for the sample
708
+ cross_attention_token_masks.append(np.array(mask))
709
+ final_input_ids.append(converted_ids)
710
+ final_attention_mask.append(converted_attn_mask)
711
+
712
+ # Step 7: Calculate position_ids and vision_position_ids
713
+ if original_encoding:
714
+ batch_position_ids = []
715
+ batch_vision_position_ids = []
716
+
717
+ # NOTE: The logic is now changed to KEEP the <|image|> tokens in the input_ids.
718
+ # `final_input_ids` already contains the full sequence, and we will not filter it.
719
+ for i, ids in enumerate(final_input_ids):
720
+ # Step 7.1: Calculate `attention_mask_arr` and `image_mask` for `position_ids`
721
+ ids_arr = np.array(ids, dtype=np.int64)
722
+ attention_mask_arr = np.array(final_attention_mask[i], dtype=np.int64)
723
+ image_mask = ids_arr == self.image_token_id
724
+
725
+ # Step 7.2: Calculate `position_ids`
726
+ # Always calculate `position_ids`.
727
+ position_ids = np.cumsum(attention_mask_arr, dtype=np.int64) - 1
728
+ position_ids[attention_mask_arr == 0] = self.pad_position_id
729
+ batch_position_ids.append(position_ids)
730
+
731
+ # Step 7.3: Calculate `vision_position_ids`
732
+ # `vision_position_ids` are only calculated if add_video_position_encoding is enabled and we have media input
733
+ if self.add_video_position_encoding and any(batch_media):
734
+ batch_vision_position_ids.append(position_ids[image_mask])
735
+
736
+ # Step 8: Padding
737
+ if original_encoding:
738
+ # Step 8.1: Pad `input_ids`
739
+ data["input_ids"] = self._pad_sequences(
740
+ final_input_ids,
741
+ self.tokenizer.pad_token_id,
742
+ padding_side=self.tokenizer.padding_side,
743
+ pad_to_multiple_of=text_kwargs.get("pad_to_multiple_of"),
744
+ )
745
+
746
+ # Step 8.2: Pad `attention_mask`
747
+ data["attention_mask"] = self._pad_sequences(
748
+ final_attention_mask,
749
+ 0,
750
+ padding_side=self.tokenizer.padding_side,
751
+ pad_to_multiple_of=text_kwargs.get("pad_to_multiple_of"),
752
+ )
753
+
754
+ # Step 8.3: Pad `padded_cross_attention_token_masks`
755
+ padded_cross_attention_token_masks = self._pad_sequences(
756
+ cross_attention_token_masks,
757
+ self.cross_attention_token_mask_pad_token_id,
758
+ padding_side=self.tokenizer.padding_side,
759
+ pad_to_multiple_of=text_kwargs.get("pad_to_multiple_of"),
760
+ )
761
+
762
+ # Step 8.4: Pad `position_ids`
763
+ data["position_ids"] = self._pad_sequences(
764
+ batch_position_ids,
765
+ self.pad_position_id,
766
+ padding_side=self.tokenizer.padding_side,
767
+ pad_to_multiple_of=text_kwargs.get("pad_to_multiple_of"),
768
+ )
769
+
770
+ # Step 8.5: Pad `vision_position_ids`
771
+ if self.add_video_position_encoding and any(batch_media):
772
+ # For vision_position_ids, we don't pad to multiple of.
773
+ # It must be right-padded to align with multi-modal feature processing.
774
+ data["vision_position_ids"] = self._pad_sequences(
775
+ batch_vision_position_ids,
776
+ self.pad_position_id,
777
+ padding_side="right",
778
+ )
779
+
780
+ # Step 9: Convert sparse cross attention token masks to dense
781
+ # original_encoding is not empty means: input_text is not empty
782
+ # num_tiles_batch is not empty means: images or videos are provided
783
+ if original_encoding and num_tiles_batch:
784
+ # shape is (batch_size, seq_len, max_num_images, max_num_tiles)
785
+ cross_attention_mask = convert_sparse_cross_attention_mask_to_dense(
786
+ padded_cross_attention_token_masks,
787
+ num_tiles=num_tiles_batch,
788
+ max_num_tiles=max_image_tiles,
789
+ cross_attention_token_mask_pad_token_id=self.cross_attention_token_mask_pad_token_id,
790
+ )
791
+ data["cross_attention_mask"] = cross_attention_mask
792
+
793
+ # Step 10: Return the batch feature
794
+ return_tensors = common_kwargs.pop("return_tensors", None)
795
+ batch_feature = BatchFeature(data=data, tensor_type=return_tensors)
796
+
797
+ return batch_feature
798
+
799
+ def batch_decode(self, *args, **kwargs):
800
+ """
801
+ This method forwards all its arguments to PreTrainedTokenizerFast's [`~PreTrainedTokenizer.batch_decode`]. Please
802
+ refer to the docstring of this method for more information.
803
+ """
804
+ return self.tokenizer.batch_decode(*args, **kwargs)
805
+
806
+ def decode(self, *args, **kwargs):
807
+ """
808
+ This method forwards all its arguments to PreTrainedTokenizerFast's [`~PreTrainedTokenizer.decode`]. Please refer to
809
+ the docstring of this method for more information.
810
+ """
811
+ return self.tokenizer.decode(*args, **kwargs)
812
+
813
+ def post_process_image_text_to_text(self, generated_outputs):
814
+ """
815
+ Post-process the output of the model to decode the text.
816
+
817
+ Args:
818
+ generated_outputs (`torch.Tensor` or `np.ndarray`):
819
+ The output of the model `generate` function. The output is expected to be a tensor of shape `(batch_size, sequence_length)`
820
+ or `(sequence_length,)`.
821
+
822
+ Returns:
823
+ `List[str]`: The decoded text.
824
+ """
825
+ return self.tokenizer.batch_decode(
826
+ generated_outputs, skip_special_tokens=True, clean_up_tokenization_spaces=False
827
+ )
828
+
829
+ @property
830
+ def model_input_names(self):
831
+ tokenizer_input_names = self.tokenizer.model_input_names
832
+ image_processor_input_names = self.image_processor.model_input_names
833
+ model_inputs = list(tokenizer_input_names + image_processor_input_names + ["cross_attention_mask"])
834
+ if self.add_video_position_encoding:
835
+ model_inputs.extend(["position_ids", "vision_position_ids"])
836
+ return model_inputs
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_id|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|finetune_right_pad_id|>",
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:82bb571a4617b204036d75be2f8b4443a854a7cbbdb0b5c55ab9eac790d0e68b
3
+ size 17210236
tokenizer_config.json ADDED
@@ -0,0 +1,2082 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "128000": {
4
+ "content": "<|begin_of_text|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "128001": {
12
+ "content": "<|end_of_text|>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "128002": {
20
+ "content": "<|reserved_special_token_0|>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "128003": {
28
+ "content": "<|reserved_special_token_1|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "128004": {
36
+ "content": "<|finetune_right_pad_id|>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "128005": {
44
+ "content": "<|step_id|>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "128006": {
52
+ "content": "<|start_header_id|>",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ },
59
+ "128007": {
60
+ "content": "<|end_header_id|>",
61
+ "lstrip": false,
62
+ "normalized": false,
63
+ "rstrip": false,
64
+ "single_word": false,
65
+ "special": true
66
+ },
67
+ "128008": {
68
+ "content": "<|eom_id|>",
69
+ "lstrip": false,
70
+ "normalized": false,
71
+ "rstrip": false,
72
+ "single_word": false,
73
+ "special": true
74
+ },
75
+ "128009": {
76
+ "content": "<|eot_id|>",
77
+ "lstrip": false,
78
+ "normalized": false,
79
+ "rstrip": false,
80
+ "single_word": false,
81
+ "special": true
82
+ },
83
+ "128010": {
84
+ "content": "<|python_tag|>",
85
+ "lstrip": false,
86
+ "normalized": false,
87
+ "rstrip": false,
88
+ "single_word": false,
89
+ "special": true
90
+ },
91
+ "128011": {
92
+ "content": "<|silence|>",
93
+ "lstrip": false,
94
+ "normalized": false,
95
+ "rstrip": false,
96
+ "single_word": false,
97
+ "special": true
98
+ },
99
+ "128012": {
100
+ "content": "<|...|>",
101
+ "lstrip": false,
102
+ "normalized": false,
103
+ "rstrip": false,
104
+ "single_word": false,
105
+ "special": true
106
+ },
107
+ "128013": {
108
+ "content": "<|reserved_special_token_4|>",
109
+ "lstrip": false,
110
+ "normalized": false,
111
+ "rstrip": false,
112
+ "single_word": false,
113
+ "special": true
114
+ },
115
+ "128014": {
116
+ "content": "<|reserved_special_token_5|>",
117
+ "lstrip": false,
118
+ "normalized": false,
119
+ "rstrip": false,
120
+ "single_word": false,
121
+ "special": true
122
+ },
123
+ "128015": {
124
+ "content": "<|reserved_special_token_6|>",
125
+ "lstrip": false,
126
+ "normalized": false,
127
+ "rstrip": false,
128
+ "single_word": false,
129
+ "special": true
130
+ },
131
+ "128016": {
132
+ "content": "<|reserved_special_token_7|>",
133
+ "lstrip": false,
134
+ "normalized": false,
135
+ "rstrip": false,
136
+ "single_word": false,
137
+ "special": true
138
+ },
139
+ "128017": {
140
+ "content": "<|reserved_special_token_8|>",
141
+ "lstrip": false,
142
+ "normalized": false,
143
+ "rstrip": false,
144
+ "single_word": false,
145
+ "special": true
146
+ },
147
+ "128018": {
148
+ "content": "<|reserved_special_token_9|>",
149
+ "lstrip": false,
150
+ "normalized": false,
151
+ "rstrip": false,
152
+ "single_word": false,
153
+ "special": true
154
+ },
155
+ "128019": {
156
+ "content": "<|reserved_special_token_10|>",
157
+ "lstrip": false,
158
+ "normalized": false,
159
+ "rstrip": false,
160
+ "single_word": false,
161
+ "special": true
162
+ },
163
+ "128020": {
164
+ "content": "<|reserved_special_token_11|>",
165
+ "lstrip": false,
166
+ "normalized": false,
167
+ "rstrip": false,
168
+ "single_word": false,
169
+ "special": true
170
+ },
171
+ "128021": {
172
+ "content": "<|reserved_special_token_12|>",
173
+ "lstrip": false,
174
+ "normalized": false,
175
+ "rstrip": false,
176
+ "single_word": false,
177
+ "special": true
178
+ },
179
+ "128022": {
180
+ "content": "<|reserved_special_token_13|>",
181
+ "lstrip": false,
182
+ "normalized": false,
183
+ "rstrip": false,
184
+ "single_word": false,
185
+ "special": true
186
+ },
187
+ "128023": {
188
+ "content": "<|reserved_special_token_14|>",
189
+ "lstrip": false,
190
+ "normalized": false,
191
+ "rstrip": false,
192
+ "single_word": false,
193
+ "special": true
194
+ },
195
+ "128024": {
196
+ "content": "<|reserved_special_token_15|>",
197
+ "lstrip": false,
198
+ "normalized": false,
199
+ "rstrip": false,
200
+ "single_word": false,
201
+ "special": true
202
+ },
203
+ "128025": {
204
+ "content": "<|reserved_special_token_16|>",
205
+ "lstrip": false,
206
+ "normalized": false,
207
+ "rstrip": false,
208
+ "single_word": false,
209
+ "special": true
210
+ },
211
+ "128026": {
212
+ "content": "<|reserved_special_token_17|>",
213
+ "lstrip": false,
214
+ "normalized": false,
215
+ "rstrip": false,
216
+ "single_word": false,
217
+ "special": true
218
+ },
219
+ "128027": {
220
+ "content": "<|reserved_special_token_18|>",
221
+ "lstrip": false,
222
+ "normalized": false,
223
+ "rstrip": false,
224
+ "single_word": false,
225
+ "special": true
226
+ },
227
+ "128028": {
228
+ "content": "<|reserved_special_token_19|>",
229
+ "lstrip": false,
230
+ "normalized": false,
231
+ "rstrip": false,
232
+ "single_word": false,
233
+ "special": true
234
+ },
235
+ "128029": {
236
+ "content": "<|reserved_special_token_20|>",
237
+ "lstrip": false,
238
+ "normalized": false,
239
+ "rstrip": false,
240
+ "single_word": false,
241
+ "special": true
242
+ },
243
+ "128030": {
244
+ "content": "<|reserved_special_token_21|>",
245
+ "lstrip": false,
246
+ "normalized": false,
247
+ "rstrip": false,
248
+ "single_word": false,
249
+ "special": true
250
+ },
251
+ "128031": {
252
+ "content": "<|reserved_special_token_22|>",
253
+ "lstrip": false,
254
+ "normalized": false,
255
+ "rstrip": false,
256
+ "single_word": false,
257
+ "special": true
258
+ },
259
+ "128032": {
260
+ "content": "<|reserved_special_token_23|>",
261
+ "lstrip": false,
262
+ "normalized": false,
263
+ "rstrip": false,
264
+ "single_word": false,
265
+ "special": true
266
+ },
267
+ "128033": {
268
+ "content": "<|reserved_special_token_24|>",
269
+ "lstrip": false,
270
+ "normalized": false,
271
+ "rstrip": false,
272
+ "single_word": false,
273
+ "special": true
274
+ },
275
+ "128034": {
276
+ "content": "<|reserved_special_token_25|>",
277
+ "lstrip": false,
278
+ "normalized": false,
279
+ "rstrip": false,
280
+ "single_word": false,
281
+ "special": true
282
+ },
283
+ "128035": {
284
+ "content": "<|reserved_special_token_26|>",
285
+ "lstrip": false,
286
+ "normalized": false,
287
+ "rstrip": false,
288
+ "single_word": false,
289
+ "special": true
290
+ },
291
+ "128036": {
292
+ "content": "<|reserved_special_token_27|>",
293
+ "lstrip": false,
294
+ "normalized": false,
295
+ "rstrip": false,
296
+ "single_word": false,
297
+ "special": true
298
+ },
299
+ "128037": {
300
+ "content": "<|reserved_special_token_28|>",
301
+ "lstrip": false,
302
+ "normalized": false,
303
+ "rstrip": false,
304
+ "single_word": false,
305
+ "special": true
306
+ },
307
+ "128038": {
308
+ "content": "<|reserved_special_token_29|>",
309
+ "lstrip": false,
310
+ "normalized": false,
311
+ "rstrip": false,
312
+ "single_word": false,
313
+ "special": true
314
+ },
315
+ "128039": {
316
+ "content": "<|reserved_special_token_30|>",
317
+ "lstrip": false,
318
+ "normalized": false,
319
+ "rstrip": false,
320
+ "single_word": false,
321
+ "special": true
322
+ },
323
+ "128040": {
324
+ "content": "<|reserved_special_token_31|>",
325
+ "lstrip": false,
326
+ "normalized": false,
327
+ "rstrip": false,
328
+ "single_word": false,
329
+ "special": true
330
+ },
331
+ "128041": {
332
+ "content": "<|reserved_special_token_32|>",
333
+ "lstrip": false,
334
+ "normalized": false,
335
+ "rstrip": false,
336
+ "single_word": false,
337
+ "special": true
338
+ },
339
+ "128042": {
340
+ "content": "<|reserved_special_token_33|>",
341
+ "lstrip": false,
342
+ "normalized": false,
343
+ "rstrip": false,
344
+ "single_word": false,
345
+ "special": true
346
+ },
347
+ "128043": {
348
+ "content": "<|reserved_special_token_34|>",
349
+ "lstrip": false,
350
+ "normalized": false,
351
+ "rstrip": false,
352
+ "single_word": false,
353
+ "special": true
354
+ },
355
+ "128044": {
356
+ "content": "<|reserved_special_token_35|>",
357
+ "lstrip": false,
358
+ "normalized": false,
359
+ "rstrip": false,
360
+ "single_word": false,
361
+ "special": true
362
+ },
363
+ "128045": {
364
+ "content": "<|reserved_special_token_36|>",
365
+ "lstrip": false,
366
+ "normalized": false,
367
+ "rstrip": false,
368
+ "single_word": false,
369
+ "special": true
370
+ },
371
+ "128046": {
372
+ "content": "<|reserved_special_token_37|>",
373
+ "lstrip": false,
374
+ "normalized": false,
375
+ "rstrip": false,
376
+ "single_word": false,
377
+ "special": true
378
+ },
379
+ "128047": {
380
+ "content": "<|reserved_special_token_38|>",
381
+ "lstrip": false,
382
+ "normalized": false,
383
+ "rstrip": false,
384
+ "single_word": false,
385
+ "special": true
386
+ },
387
+ "128048": {
388
+ "content": "<|reserved_special_token_39|>",
389
+ "lstrip": false,
390
+ "normalized": false,
391
+ "rstrip": false,
392
+ "single_word": false,
393
+ "special": true
394
+ },
395
+ "128049": {
396
+ "content": "<|reserved_special_token_40|>",
397
+ "lstrip": false,
398
+ "normalized": false,
399
+ "rstrip": false,
400
+ "single_word": false,
401
+ "special": true
402
+ },
403
+ "128050": {
404
+ "content": "<|reserved_special_token_41|>",
405
+ "lstrip": false,
406
+ "normalized": false,
407
+ "rstrip": false,
408
+ "single_word": false,
409
+ "special": true
410
+ },
411
+ "128051": {
412
+ "content": "<|reserved_special_token_42|>",
413
+ "lstrip": false,
414
+ "normalized": false,
415
+ "rstrip": false,
416
+ "single_word": false,
417
+ "special": true
418
+ },
419
+ "128052": {
420
+ "content": "<|reserved_special_token_43|>",
421
+ "lstrip": false,
422
+ "normalized": false,
423
+ "rstrip": false,
424
+ "single_word": false,
425
+ "special": true
426
+ },
427
+ "128053": {
428
+ "content": "<|reserved_special_token_44|>",
429
+ "lstrip": false,
430
+ "normalized": false,
431
+ "rstrip": false,
432
+ "single_word": false,
433
+ "special": true
434
+ },
435
+ "128054": {
436
+ "content": "<|reserved_special_token_45|>",
437
+ "lstrip": false,
438
+ "normalized": false,
439
+ "rstrip": false,
440
+ "single_word": false,
441
+ "special": true
442
+ },
443
+ "128055": {
444
+ "content": "<|reserved_special_token_46|>",
445
+ "lstrip": false,
446
+ "normalized": false,
447
+ "rstrip": false,
448
+ "single_word": false,
449
+ "special": true
450
+ },
451
+ "128056": {
452
+ "content": "<|reserved_special_token_47|>",
453
+ "lstrip": false,
454
+ "normalized": false,
455
+ "rstrip": false,
456
+ "single_word": false,
457
+ "special": true
458
+ },
459
+ "128057": {
460
+ "content": "<|reserved_special_token_48|>",
461
+ "lstrip": false,
462
+ "normalized": false,
463
+ "rstrip": false,
464
+ "single_word": false,
465
+ "special": true
466
+ },
467
+ "128058": {
468
+ "content": "<|reserved_special_token_49|>",
469
+ "lstrip": false,
470
+ "normalized": false,
471
+ "rstrip": false,
472
+ "single_word": false,
473
+ "special": true
474
+ },
475
+ "128059": {
476
+ "content": "<|reserved_special_token_50|>",
477
+ "lstrip": false,
478
+ "normalized": false,
479
+ "rstrip": false,
480
+ "single_word": false,
481
+ "special": true
482
+ },
483
+ "128060": {
484
+ "content": "<|reserved_special_token_51|>",
485
+ "lstrip": false,
486
+ "normalized": false,
487
+ "rstrip": false,
488
+ "single_word": false,
489
+ "special": true
490
+ },
491
+ "128061": {
492
+ "content": "<|reserved_special_token_52|>",
493
+ "lstrip": false,
494
+ "normalized": false,
495
+ "rstrip": false,
496
+ "single_word": false,
497
+ "special": true
498
+ },
499
+ "128062": {
500
+ "content": "<|reserved_special_token_53|>",
501
+ "lstrip": false,
502
+ "normalized": false,
503
+ "rstrip": false,
504
+ "single_word": false,
505
+ "special": true
506
+ },
507
+ "128063": {
508
+ "content": "<|reserved_special_token_54|>",
509
+ "lstrip": false,
510
+ "normalized": false,
511
+ "rstrip": false,
512
+ "single_word": false,
513
+ "special": true
514
+ },
515
+ "128064": {
516
+ "content": "<|reserved_special_token_55|>",
517
+ "lstrip": false,
518
+ "normalized": false,
519
+ "rstrip": false,
520
+ "single_word": false,
521
+ "special": true
522
+ },
523
+ "128065": {
524
+ "content": "<|reserved_special_token_56|>",
525
+ "lstrip": false,
526
+ "normalized": false,
527
+ "rstrip": false,
528
+ "single_word": false,
529
+ "special": true
530
+ },
531
+ "128066": {
532
+ "content": "<|reserved_special_token_57|>",
533
+ "lstrip": false,
534
+ "normalized": false,
535
+ "rstrip": false,
536
+ "single_word": false,
537
+ "special": true
538
+ },
539
+ "128067": {
540
+ "content": "<|reserved_special_token_58|>",
541
+ "lstrip": false,
542
+ "normalized": false,
543
+ "rstrip": false,
544
+ "single_word": false,
545
+ "special": true
546
+ },
547
+ "128068": {
548
+ "content": "<|reserved_special_token_59|>",
549
+ "lstrip": false,
550
+ "normalized": false,
551
+ "rstrip": false,
552
+ "single_word": false,
553
+ "special": true
554
+ },
555
+ "128069": {
556
+ "content": "<|reserved_special_token_60|>",
557
+ "lstrip": false,
558
+ "normalized": false,
559
+ "rstrip": false,
560
+ "single_word": false,
561
+ "special": true
562
+ },
563
+ "128070": {
564
+ "content": "<|reserved_special_token_61|>",
565
+ "lstrip": false,
566
+ "normalized": false,
567
+ "rstrip": false,
568
+ "single_word": false,
569
+ "special": true
570
+ },
571
+ "128071": {
572
+ "content": "<|reserved_special_token_62|>",
573
+ "lstrip": false,
574
+ "normalized": false,
575
+ "rstrip": false,
576
+ "single_word": false,
577
+ "special": true
578
+ },
579
+ "128072": {
580
+ "content": "<|reserved_special_token_63|>",
581
+ "lstrip": false,
582
+ "normalized": false,
583
+ "rstrip": false,
584
+ "single_word": false,
585
+ "special": true
586
+ },
587
+ "128073": {
588
+ "content": "<|reserved_special_token_64|>",
589
+ "lstrip": false,
590
+ "normalized": false,
591
+ "rstrip": false,
592
+ "single_word": false,
593
+ "special": true
594
+ },
595
+ "128074": {
596
+ "content": "<|reserved_special_token_65|>",
597
+ "lstrip": false,
598
+ "normalized": false,
599
+ "rstrip": false,
600
+ "single_word": false,
601
+ "special": true
602
+ },
603
+ "128075": {
604
+ "content": "<|reserved_special_token_66|>",
605
+ "lstrip": false,
606
+ "normalized": false,
607
+ "rstrip": false,
608
+ "single_word": false,
609
+ "special": true
610
+ },
611
+ "128076": {
612
+ "content": "<|reserved_special_token_67|>",
613
+ "lstrip": false,
614
+ "normalized": false,
615
+ "rstrip": false,
616
+ "single_word": false,
617
+ "special": true
618
+ },
619
+ "128077": {
620
+ "content": "<|reserved_special_token_68|>",
621
+ "lstrip": false,
622
+ "normalized": false,
623
+ "rstrip": false,
624
+ "single_word": false,
625
+ "special": true
626
+ },
627
+ "128078": {
628
+ "content": "<|reserved_special_token_69|>",
629
+ "lstrip": false,
630
+ "normalized": false,
631
+ "rstrip": false,
632
+ "single_word": false,
633
+ "special": true
634
+ },
635
+ "128079": {
636
+ "content": "<|reserved_special_token_70|>",
637
+ "lstrip": false,
638
+ "normalized": false,
639
+ "rstrip": false,
640
+ "single_word": false,
641
+ "special": true
642
+ },
643
+ "128080": {
644
+ "content": "<|reserved_special_token_71|>",
645
+ "lstrip": false,
646
+ "normalized": false,
647
+ "rstrip": false,
648
+ "single_word": false,
649
+ "special": true
650
+ },
651
+ "128081": {
652
+ "content": "<|reserved_special_token_72|>",
653
+ "lstrip": false,
654
+ "normalized": false,
655
+ "rstrip": false,
656
+ "single_word": false,
657
+ "special": true
658
+ },
659
+ "128082": {
660
+ "content": "<|reserved_special_token_73|>",
661
+ "lstrip": false,
662
+ "normalized": false,
663
+ "rstrip": false,
664
+ "single_word": false,
665
+ "special": true
666
+ },
667
+ "128083": {
668
+ "content": "<|reserved_special_token_74|>",
669
+ "lstrip": false,
670
+ "normalized": false,
671
+ "rstrip": false,
672
+ "single_word": false,
673
+ "special": true
674
+ },
675
+ "128084": {
676
+ "content": "<|reserved_special_token_75|>",
677
+ "lstrip": false,
678
+ "normalized": false,
679
+ "rstrip": false,
680
+ "single_word": false,
681
+ "special": true
682
+ },
683
+ "128085": {
684
+ "content": "<|reserved_special_token_76|>",
685
+ "lstrip": false,
686
+ "normalized": false,
687
+ "rstrip": false,
688
+ "single_word": false,
689
+ "special": true
690
+ },
691
+ "128086": {
692
+ "content": "<|reserved_special_token_77|>",
693
+ "lstrip": false,
694
+ "normalized": false,
695
+ "rstrip": false,
696
+ "single_word": false,
697
+ "special": true
698
+ },
699
+ "128087": {
700
+ "content": "<|reserved_special_token_78|>",
701
+ "lstrip": false,
702
+ "normalized": false,
703
+ "rstrip": false,
704
+ "single_word": false,
705
+ "special": true
706
+ },
707
+ "128088": {
708
+ "content": "<|reserved_special_token_79|>",
709
+ "lstrip": false,
710
+ "normalized": false,
711
+ "rstrip": false,
712
+ "single_word": false,
713
+ "special": true
714
+ },
715
+ "128089": {
716
+ "content": "<|reserved_special_token_80|>",
717
+ "lstrip": false,
718
+ "normalized": false,
719
+ "rstrip": false,
720
+ "single_word": false,
721
+ "special": true
722
+ },
723
+ "128090": {
724
+ "content": "<|reserved_special_token_81|>",
725
+ "lstrip": false,
726
+ "normalized": false,
727
+ "rstrip": false,
728
+ "single_word": false,
729
+ "special": true
730
+ },
731
+ "128091": {
732
+ "content": "<|reserved_special_token_82|>",
733
+ "lstrip": false,
734
+ "normalized": false,
735
+ "rstrip": false,
736
+ "single_word": false,
737
+ "special": true
738
+ },
739
+ "128092": {
740
+ "content": "<|reserved_special_token_83|>",
741
+ "lstrip": false,
742
+ "normalized": false,
743
+ "rstrip": false,
744
+ "single_word": false,
745
+ "special": true
746
+ },
747
+ "128093": {
748
+ "content": "<|reserved_special_token_84|>",
749
+ "lstrip": false,
750
+ "normalized": false,
751
+ "rstrip": false,
752
+ "single_word": false,
753
+ "special": true
754
+ },
755
+ "128094": {
756
+ "content": "<|reserved_special_token_85|>",
757
+ "lstrip": false,
758
+ "normalized": false,
759
+ "rstrip": false,
760
+ "single_word": false,
761
+ "special": true
762
+ },
763
+ "128095": {
764
+ "content": "<|reserved_special_token_86|>",
765
+ "lstrip": false,
766
+ "normalized": false,
767
+ "rstrip": false,
768
+ "single_word": false,
769
+ "special": true
770
+ },
771
+ "128096": {
772
+ "content": "<|reserved_special_token_87|>",
773
+ "lstrip": false,
774
+ "normalized": false,
775
+ "rstrip": false,
776
+ "single_word": false,
777
+ "special": true
778
+ },
779
+ "128097": {
780
+ "content": "<|reserved_special_token_88|>",
781
+ "lstrip": false,
782
+ "normalized": false,
783
+ "rstrip": false,
784
+ "single_word": false,
785
+ "special": true
786
+ },
787
+ "128098": {
788
+ "content": "<|reserved_special_token_89|>",
789
+ "lstrip": false,
790
+ "normalized": false,
791
+ "rstrip": false,
792
+ "single_word": false,
793
+ "special": true
794
+ },
795
+ "128099": {
796
+ "content": "<|reserved_special_token_90|>",
797
+ "lstrip": false,
798
+ "normalized": false,
799
+ "rstrip": false,
800
+ "single_word": false,
801
+ "special": true
802
+ },
803
+ "128100": {
804
+ "content": "<|reserved_special_token_91|>",
805
+ "lstrip": false,
806
+ "normalized": false,
807
+ "rstrip": false,
808
+ "single_word": false,
809
+ "special": true
810
+ },
811
+ "128101": {
812
+ "content": "<|reserved_special_token_92|>",
813
+ "lstrip": false,
814
+ "normalized": false,
815
+ "rstrip": false,
816
+ "single_word": false,
817
+ "special": true
818
+ },
819
+ "128102": {
820
+ "content": "<|reserved_special_token_93|>",
821
+ "lstrip": false,
822
+ "normalized": false,
823
+ "rstrip": false,
824
+ "single_word": false,
825
+ "special": true
826
+ },
827
+ "128103": {
828
+ "content": "<|reserved_special_token_94|>",
829
+ "lstrip": false,
830
+ "normalized": false,
831
+ "rstrip": false,
832
+ "single_word": false,
833
+ "special": true
834
+ },
835
+ "128104": {
836
+ "content": "<|reserved_special_token_95|>",
837
+ "lstrip": false,
838
+ "normalized": false,
839
+ "rstrip": false,
840
+ "single_word": false,
841
+ "special": true
842
+ },
843
+ "128105": {
844
+ "content": "<|reserved_special_token_96|>",
845
+ "lstrip": false,
846
+ "normalized": false,
847
+ "rstrip": false,
848
+ "single_word": false,
849
+ "special": true
850
+ },
851
+ "128106": {
852
+ "content": "<|reserved_special_token_97|>",
853
+ "lstrip": false,
854
+ "normalized": false,
855
+ "rstrip": false,
856
+ "single_word": false,
857
+ "special": true
858
+ },
859
+ "128107": {
860
+ "content": "<|reserved_special_token_98|>",
861
+ "lstrip": false,
862
+ "normalized": false,
863
+ "rstrip": false,
864
+ "single_word": false,
865
+ "special": true
866
+ },
867
+ "128108": {
868
+ "content": "<|reserved_special_token_99|>",
869
+ "lstrip": false,
870
+ "normalized": false,
871
+ "rstrip": false,
872
+ "single_word": false,
873
+ "special": true
874
+ },
875
+ "128109": {
876
+ "content": "<|reserved_special_token_100|>",
877
+ "lstrip": false,
878
+ "normalized": false,
879
+ "rstrip": false,
880
+ "single_word": false,
881
+ "special": true
882
+ },
883
+ "128110": {
884
+ "content": "<|reserved_special_token_101|>",
885
+ "lstrip": false,
886
+ "normalized": false,
887
+ "rstrip": false,
888
+ "single_word": false,
889
+ "special": true
890
+ },
891
+ "128111": {
892
+ "content": "<|reserved_special_token_102|>",
893
+ "lstrip": false,
894
+ "normalized": false,
895
+ "rstrip": false,
896
+ "single_word": false,
897
+ "special": true
898
+ },
899
+ "128112": {
900
+ "content": "<|reserved_special_token_103|>",
901
+ "lstrip": false,
902
+ "normalized": false,
903
+ "rstrip": false,
904
+ "single_word": false,
905
+ "special": true
906
+ },
907
+ "128113": {
908
+ "content": "<|reserved_special_token_104|>",
909
+ "lstrip": false,
910
+ "normalized": false,
911
+ "rstrip": false,
912
+ "single_word": false,
913
+ "special": true
914
+ },
915
+ "128114": {
916
+ "content": "<|reserved_special_token_105|>",
917
+ "lstrip": false,
918
+ "normalized": false,
919
+ "rstrip": false,
920
+ "single_word": false,
921
+ "special": true
922
+ },
923
+ "128115": {
924
+ "content": "<|reserved_special_token_106|>",
925
+ "lstrip": false,
926
+ "normalized": false,
927
+ "rstrip": false,
928
+ "single_word": false,
929
+ "special": true
930
+ },
931
+ "128116": {
932
+ "content": "<|reserved_special_token_107|>",
933
+ "lstrip": false,
934
+ "normalized": false,
935
+ "rstrip": false,
936
+ "single_word": false,
937
+ "special": true
938
+ },
939
+ "128117": {
940
+ "content": "<|reserved_special_token_108|>",
941
+ "lstrip": false,
942
+ "normalized": false,
943
+ "rstrip": false,
944
+ "single_word": false,
945
+ "special": true
946
+ },
947
+ "128118": {
948
+ "content": "<|reserved_special_token_109|>",
949
+ "lstrip": false,
950
+ "normalized": false,
951
+ "rstrip": false,
952
+ "single_word": false,
953
+ "special": true
954
+ },
955
+ "128119": {
956
+ "content": "<|reserved_special_token_110|>",
957
+ "lstrip": false,
958
+ "normalized": false,
959
+ "rstrip": false,
960
+ "single_word": false,
961
+ "special": true
962
+ },
963
+ "128120": {
964
+ "content": "<|reserved_special_token_111|>",
965
+ "lstrip": false,
966
+ "normalized": false,
967
+ "rstrip": false,
968
+ "single_word": false,
969
+ "special": true
970
+ },
971
+ "128121": {
972
+ "content": "<|reserved_special_token_112|>",
973
+ "lstrip": false,
974
+ "normalized": false,
975
+ "rstrip": false,
976
+ "single_word": false,
977
+ "special": true
978
+ },
979
+ "128122": {
980
+ "content": "<|reserved_special_token_113|>",
981
+ "lstrip": false,
982
+ "normalized": false,
983
+ "rstrip": false,
984
+ "single_word": false,
985
+ "special": true
986
+ },
987
+ "128123": {
988
+ "content": "<|reserved_special_token_114|>",
989
+ "lstrip": false,
990
+ "normalized": false,
991
+ "rstrip": false,
992
+ "single_word": false,
993
+ "special": true
994
+ },
995
+ "128124": {
996
+ "content": "<|reserved_special_token_115|>",
997
+ "lstrip": false,
998
+ "normalized": false,
999
+ "rstrip": false,
1000
+ "single_word": false,
1001
+ "special": true
1002
+ },
1003
+ "128125": {
1004
+ "content": "<|reserved_special_token_116|>",
1005
+ "lstrip": false,
1006
+ "normalized": false,
1007
+ "rstrip": false,
1008
+ "single_word": false,
1009
+ "special": true
1010
+ },
1011
+ "128126": {
1012
+ "content": "<|reserved_special_token_117|>",
1013
+ "lstrip": false,
1014
+ "normalized": false,
1015
+ "rstrip": false,
1016
+ "single_word": false,
1017
+ "special": true
1018
+ },
1019
+ "128127": {
1020
+ "content": "<|reserved_special_token_118|>",
1021
+ "lstrip": false,
1022
+ "normalized": false,
1023
+ "rstrip": false,
1024
+ "single_word": false,
1025
+ "special": true
1026
+ },
1027
+ "128128": {
1028
+ "content": "<|reserved_special_token_119|>",
1029
+ "lstrip": false,
1030
+ "normalized": false,
1031
+ "rstrip": false,
1032
+ "single_word": false,
1033
+ "special": true
1034
+ },
1035
+ "128129": {
1036
+ "content": "<|reserved_special_token_120|>",
1037
+ "lstrip": false,
1038
+ "normalized": false,
1039
+ "rstrip": false,
1040
+ "single_word": false,
1041
+ "special": true
1042
+ },
1043
+ "128130": {
1044
+ "content": "<|reserved_special_token_121|>",
1045
+ "lstrip": false,
1046
+ "normalized": false,
1047
+ "rstrip": false,
1048
+ "single_word": false,
1049
+ "special": true
1050
+ },
1051
+ "128131": {
1052
+ "content": "<|reserved_special_token_122|>",
1053
+ "lstrip": false,
1054
+ "normalized": false,
1055
+ "rstrip": false,
1056
+ "single_word": false,
1057
+ "special": true
1058
+ },
1059
+ "128132": {
1060
+ "content": "<|reserved_special_token_123|>",
1061
+ "lstrip": false,
1062
+ "normalized": false,
1063
+ "rstrip": false,
1064
+ "single_word": false,
1065
+ "special": true
1066
+ },
1067
+ "128133": {
1068
+ "content": "<|reserved_special_token_124|>",
1069
+ "lstrip": false,
1070
+ "normalized": false,
1071
+ "rstrip": false,
1072
+ "single_word": false,
1073
+ "special": true
1074
+ },
1075
+ "128134": {
1076
+ "content": "<|reserved_special_token_125|>",
1077
+ "lstrip": false,
1078
+ "normalized": false,
1079
+ "rstrip": false,
1080
+ "single_word": false,
1081
+ "special": true
1082
+ },
1083
+ "128135": {
1084
+ "content": "<|reserved_special_token_126|>",
1085
+ "lstrip": false,
1086
+ "normalized": false,
1087
+ "rstrip": false,
1088
+ "single_word": false,
1089
+ "special": true
1090
+ },
1091
+ "128136": {
1092
+ "content": "<|reserved_special_token_127|>",
1093
+ "lstrip": false,
1094
+ "normalized": false,
1095
+ "rstrip": false,
1096
+ "single_word": false,
1097
+ "special": true
1098
+ },
1099
+ "128137": {
1100
+ "content": "<|reserved_special_token_128|>",
1101
+ "lstrip": false,
1102
+ "normalized": false,
1103
+ "rstrip": false,
1104
+ "single_word": false,
1105
+ "special": true
1106
+ },
1107
+ "128138": {
1108
+ "content": "<|reserved_special_token_129|>",
1109
+ "lstrip": false,
1110
+ "normalized": false,
1111
+ "rstrip": false,
1112
+ "single_word": false,
1113
+ "special": true
1114
+ },
1115
+ "128139": {
1116
+ "content": "<|reserved_special_token_130|>",
1117
+ "lstrip": false,
1118
+ "normalized": false,
1119
+ "rstrip": false,
1120
+ "single_word": false,
1121
+ "special": true
1122
+ },
1123
+ "128140": {
1124
+ "content": "<|reserved_special_token_131|>",
1125
+ "lstrip": false,
1126
+ "normalized": false,
1127
+ "rstrip": false,
1128
+ "single_word": false,
1129
+ "special": true
1130
+ },
1131
+ "128141": {
1132
+ "content": "<|reserved_special_token_132|>",
1133
+ "lstrip": false,
1134
+ "normalized": false,
1135
+ "rstrip": false,
1136
+ "single_word": false,
1137
+ "special": true
1138
+ },
1139
+ "128142": {
1140
+ "content": "<|reserved_special_token_133|>",
1141
+ "lstrip": false,
1142
+ "normalized": false,
1143
+ "rstrip": false,
1144
+ "single_word": false,
1145
+ "special": true
1146
+ },
1147
+ "128143": {
1148
+ "content": "<|reserved_special_token_134|>",
1149
+ "lstrip": false,
1150
+ "normalized": false,
1151
+ "rstrip": false,
1152
+ "single_word": false,
1153
+ "special": true
1154
+ },
1155
+ "128144": {
1156
+ "content": "<|reserved_special_token_135|>",
1157
+ "lstrip": false,
1158
+ "normalized": false,
1159
+ "rstrip": false,
1160
+ "single_word": false,
1161
+ "special": true
1162
+ },
1163
+ "128145": {
1164
+ "content": "<|reserved_special_token_136|>",
1165
+ "lstrip": false,
1166
+ "normalized": false,
1167
+ "rstrip": false,
1168
+ "single_word": false,
1169
+ "special": true
1170
+ },
1171
+ "128146": {
1172
+ "content": "<|reserved_special_token_137|>",
1173
+ "lstrip": false,
1174
+ "normalized": false,
1175
+ "rstrip": false,
1176
+ "single_word": false,
1177
+ "special": true
1178
+ },
1179
+ "128147": {
1180
+ "content": "<|reserved_special_token_138|>",
1181
+ "lstrip": false,
1182
+ "normalized": false,
1183
+ "rstrip": false,
1184
+ "single_word": false,
1185
+ "special": true
1186
+ },
1187
+ "128148": {
1188
+ "content": "<|reserved_special_token_139|>",
1189
+ "lstrip": false,
1190
+ "normalized": false,
1191
+ "rstrip": false,
1192
+ "single_word": false,
1193
+ "special": true
1194
+ },
1195
+ "128149": {
1196
+ "content": "<|reserved_special_token_140|>",
1197
+ "lstrip": false,
1198
+ "normalized": false,
1199
+ "rstrip": false,
1200
+ "single_word": false,
1201
+ "special": true
1202
+ },
1203
+ "128150": {
1204
+ "content": "<|reserved_special_token_141|>",
1205
+ "lstrip": false,
1206
+ "normalized": false,
1207
+ "rstrip": false,
1208
+ "single_word": false,
1209
+ "special": true
1210
+ },
1211
+ "128151": {
1212
+ "content": "<|reserved_special_token_142|>",
1213
+ "lstrip": false,
1214
+ "normalized": false,
1215
+ "rstrip": false,
1216
+ "single_word": false,
1217
+ "special": true
1218
+ },
1219
+ "128152": {
1220
+ "content": "<|reserved_special_token_143|>",
1221
+ "lstrip": false,
1222
+ "normalized": false,
1223
+ "rstrip": false,
1224
+ "single_word": false,
1225
+ "special": true
1226
+ },
1227
+ "128153": {
1228
+ "content": "<|reserved_special_token_144|>",
1229
+ "lstrip": false,
1230
+ "normalized": false,
1231
+ "rstrip": false,
1232
+ "single_word": false,
1233
+ "special": true
1234
+ },
1235
+ "128154": {
1236
+ "content": "<|reserved_special_token_145|>",
1237
+ "lstrip": false,
1238
+ "normalized": false,
1239
+ "rstrip": false,
1240
+ "single_word": false,
1241
+ "special": true
1242
+ },
1243
+ "128155": {
1244
+ "content": "<|reserved_special_token_146|>",
1245
+ "lstrip": false,
1246
+ "normalized": false,
1247
+ "rstrip": false,
1248
+ "single_word": false,
1249
+ "special": true
1250
+ },
1251
+ "128156": {
1252
+ "content": "<|reserved_special_token_147|>",
1253
+ "lstrip": false,
1254
+ "normalized": false,
1255
+ "rstrip": false,
1256
+ "single_word": false,
1257
+ "special": true
1258
+ },
1259
+ "128157": {
1260
+ "content": "<|reserved_special_token_148|>",
1261
+ "lstrip": false,
1262
+ "normalized": false,
1263
+ "rstrip": false,
1264
+ "single_word": false,
1265
+ "special": true
1266
+ },
1267
+ "128158": {
1268
+ "content": "<|reserved_special_token_149|>",
1269
+ "lstrip": false,
1270
+ "normalized": false,
1271
+ "rstrip": false,
1272
+ "single_word": false,
1273
+ "special": true
1274
+ },
1275
+ "128159": {
1276
+ "content": "<|reserved_special_token_150|>",
1277
+ "lstrip": false,
1278
+ "normalized": false,
1279
+ "rstrip": false,
1280
+ "single_word": false,
1281
+ "special": true
1282
+ },
1283
+ "128160": {
1284
+ "content": "<|reserved_special_token_151|>",
1285
+ "lstrip": false,
1286
+ "normalized": false,
1287
+ "rstrip": false,
1288
+ "single_word": false,
1289
+ "special": true
1290
+ },
1291
+ "128161": {
1292
+ "content": "<|reserved_special_token_152|>",
1293
+ "lstrip": false,
1294
+ "normalized": false,
1295
+ "rstrip": false,
1296
+ "single_word": false,
1297
+ "special": true
1298
+ },
1299
+ "128162": {
1300
+ "content": "<|reserved_special_token_153|>",
1301
+ "lstrip": false,
1302
+ "normalized": false,
1303
+ "rstrip": false,
1304
+ "single_word": false,
1305
+ "special": true
1306
+ },
1307
+ "128163": {
1308
+ "content": "<|reserved_special_token_154|>",
1309
+ "lstrip": false,
1310
+ "normalized": false,
1311
+ "rstrip": false,
1312
+ "single_word": false,
1313
+ "special": true
1314
+ },
1315
+ "128164": {
1316
+ "content": "<|reserved_special_token_155|>",
1317
+ "lstrip": false,
1318
+ "normalized": false,
1319
+ "rstrip": false,
1320
+ "single_word": false,
1321
+ "special": true
1322
+ },
1323
+ "128165": {
1324
+ "content": "<|reserved_special_token_156|>",
1325
+ "lstrip": false,
1326
+ "normalized": false,
1327
+ "rstrip": false,
1328
+ "single_word": false,
1329
+ "special": true
1330
+ },
1331
+ "128166": {
1332
+ "content": "<|reserved_special_token_157|>",
1333
+ "lstrip": false,
1334
+ "normalized": false,
1335
+ "rstrip": false,
1336
+ "single_word": false,
1337
+ "special": true
1338
+ },
1339
+ "128167": {
1340
+ "content": "<|reserved_special_token_158|>",
1341
+ "lstrip": false,
1342
+ "normalized": false,
1343
+ "rstrip": false,
1344
+ "single_word": false,
1345
+ "special": true
1346
+ },
1347
+ "128168": {
1348
+ "content": "<|reserved_special_token_159|>",
1349
+ "lstrip": false,
1350
+ "normalized": false,
1351
+ "rstrip": false,
1352
+ "single_word": false,
1353
+ "special": true
1354
+ },
1355
+ "128169": {
1356
+ "content": "<|reserved_special_token_160|>",
1357
+ "lstrip": false,
1358
+ "normalized": false,
1359
+ "rstrip": false,
1360
+ "single_word": false,
1361
+ "special": true
1362
+ },
1363
+ "128170": {
1364
+ "content": "<|reserved_special_token_161|>",
1365
+ "lstrip": false,
1366
+ "normalized": false,
1367
+ "rstrip": false,
1368
+ "single_word": false,
1369
+ "special": true
1370
+ },
1371
+ "128171": {
1372
+ "content": "<|reserved_special_token_162|>",
1373
+ "lstrip": false,
1374
+ "normalized": false,
1375
+ "rstrip": false,
1376
+ "single_word": false,
1377
+ "special": true
1378
+ },
1379
+ "128172": {
1380
+ "content": "<|reserved_special_token_163|>",
1381
+ "lstrip": false,
1382
+ "normalized": false,
1383
+ "rstrip": false,
1384
+ "single_word": false,
1385
+ "special": true
1386
+ },
1387
+ "128173": {
1388
+ "content": "<|reserved_special_token_164|>",
1389
+ "lstrip": false,
1390
+ "normalized": false,
1391
+ "rstrip": false,
1392
+ "single_word": false,
1393
+ "special": true
1394
+ },
1395
+ "128174": {
1396
+ "content": "<|reserved_special_token_165|>",
1397
+ "lstrip": false,
1398
+ "normalized": false,
1399
+ "rstrip": false,
1400
+ "single_word": false,
1401
+ "special": true
1402
+ },
1403
+ "128175": {
1404
+ "content": "<|reserved_special_token_166|>",
1405
+ "lstrip": false,
1406
+ "normalized": false,
1407
+ "rstrip": false,
1408
+ "single_word": false,
1409
+ "special": true
1410
+ },
1411
+ "128176": {
1412
+ "content": "<|reserved_special_token_167|>",
1413
+ "lstrip": false,
1414
+ "normalized": false,
1415
+ "rstrip": false,
1416
+ "single_word": false,
1417
+ "special": true
1418
+ },
1419
+ "128177": {
1420
+ "content": "<|reserved_special_token_168|>",
1421
+ "lstrip": false,
1422
+ "normalized": false,
1423
+ "rstrip": false,
1424
+ "single_word": false,
1425
+ "special": true
1426
+ },
1427
+ "128178": {
1428
+ "content": "<|reserved_special_token_169|>",
1429
+ "lstrip": false,
1430
+ "normalized": false,
1431
+ "rstrip": false,
1432
+ "single_word": false,
1433
+ "special": true
1434
+ },
1435
+ "128179": {
1436
+ "content": "<|reserved_special_token_170|>",
1437
+ "lstrip": false,
1438
+ "normalized": false,
1439
+ "rstrip": false,
1440
+ "single_word": false,
1441
+ "special": true
1442
+ },
1443
+ "128180": {
1444
+ "content": "<|reserved_special_token_171|>",
1445
+ "lstrip": false,
1446
+ "normalized": false,
1447
+ "rstrip": false,
1448
+ "single_word": false,
1449
+ "special": true
1450
+ },
1451
+ "128181": {
1452
+ "content": "<|reserved_special_token_172|>",
1453
+ "lstrip": false,
1454
+ "normalized": false,
1455
+ "rstrip": false,
1456
+ "single_word": false,
1457
+ "special": true
1458
+ },
1459
+ "128182": {
1460
+ "content": "<|reserved_special_token_173|>",
1461
+ "lstrip": false,
1462
+ "normalized": false,
1463
+ "rstrip": false,
1464
+ "single_word": false,
1465
+ "special": true
1466
+ },
1467
+ "128183": {
1468
+ "content": "<|reserved_special_token_174|>",
1469
+ "lstrip": false,
1470
+ "normalized": false,
1471
+ "rstrip": false,
1472
+ "single_word": false,
1473
+ "special": true
1474
+ },
1475
+ "128184": {
1476
+ "content": "<|reserved_special_token_175|>",
1477
+ "lstrip": false,
1478
+ "normalized": false,
1479
+ "rstrip": false,
1480
+ "single_word": false,
1481
+ "special": true
1482
+ },
1483
+ "128185": {
1484
+ "content": "<|reserved_special_token_176|>",
1485
+ "lstrip": false,
1486
+ "normalized": false,
1487
+ "rstrip": false,
1488
+ "single_word": false,
1489
+ "special": true
1490
+ },
1491
+ "128186": {
1492
+ "content": "<|reserved_special_token_177|>",
1493
+ "lstrip": false,
1494
+ "normalized": false,
1495
+ "rstrip": false,
1496
+ "single_word": false,
1497
+ "special": true
1498
+ },
1499
+ "128187": {
1500
+ "content": "<|reserved_special_token_178|>",
1501
+ "lstrip": false,
1502
+ "normalized": false,
1503
+ "rstrip": false,
1504
+ "single_word": false,
1505
+ "special": true
1506
+ },
1507
+ "128188": {
1508
+ "content": "<|reserved_special_token_179|>",
1509
+ "lstrip": false,
1510
+ "normalized": false,
1511
+ "rstrip": false,
1512
+ "single_word": false,
1513
+ "special": true
1514
+ },
1515
+ "128189": {
1516
+ "content": "<|reserved_special_token_180|>",
1517
+ "lstrip": false,
1518
+ "normalized": false,
1519
+ "rstrip": false,
1520
+ "single_word": false,
1521
+ "special": true
1522
+ },
1523
+ "128190": {
1524
+ "content": "<|reserved_special_token_181|>",
1525
+ "lstrip": false,
1526
+ "normalized": false,
1527
+ "rstrip": false,
1528
+ "single_word": false,
1529
+ "special": true
1530
+ },
1531
+ "128191": {
1532
+ "content": "<|reserved_special_token_182|>",
1533
+ "lstrip": false,
1534
+ "normalized": false,
1535
+ "rstrip": false,
1536
+ "single_word": false,
1537
+ "special": true
1538
+ },
1539
+ "128192": {
1540
+ "content": "<|reserved_special_token_183|>",
1541
+ "lstrip": false,
1542
+ "normalized": false,
1543
+ "rstrip": false,
1544
+ "single_word": false,
1545
+ "special": true
1546
+ },
1547
+ "128193": {
1548
+ "content": "<|reserved_special_token_184|>",
1549
+ "lstrip": false,
1550
+ "normalized": false,
1551
+ "rstrip": false,
1552
+ "single_word": false,
1553
+ "special": true
1554
+ },
1555
+ "128194": {
1556
+ "content": "<|reserved_special_token_185|>",
1557
+ "lstrip": false,
1558
+ "normalized": false,
1559
+ "rstrip": false,
1560
+ "single_word": false,
1561
+ "special": true
1562
+ },
1563
+ "128195": {
1564
+ "content": "<|reserved_special_token_186|>",
1565
+ "lstrip": false,
1566
+ "normalized": false,
1567
+ "rstrip": false,
1568
+ "single_word": false,
1569
+ "special": true
1570
+ },
1571
+ "128196": {
1572
+ "content": "<|reserved_special_token_187|>",
1573
+ "lstrip": false,
1574
+ "normalized": false,
1575
+ "rstrip": false,
1576
+ "single_word": false,
1577
+ "special": true
1578
+ },
1579
+ "128197": {
1580
+ "content": "<|reserved_special_token_188|>",
1581
+ "lstrip": false,
1582
+ "normalized": false,
1583
+ "rstrip": false,
1584
+ "single_word": false,
1585
+ "special": true
1586
+ },
1587
+ "128198": {
1588
+ "content": "<|reserved_special_token_189|>",
1589
+ "lstrip": false,
1590
+ "normalized": false,
1591
+ "rstrip": false,
1592
+ "single_word": false,
1593
+ "special": true
1594
+ },
1595
+ "128199": {
1596
+ "content": "<|reserved_special_token_190|>",
1597
+ "lstrip": false,
1598
+ "normalized": false,
1599
+ "rstrip": false,
1600
+ "single_word": false,
1601
+ "special": true
1602
+ },
1603
+ "128200": {
1604
+ "content": "<|reserved_special_token_191|>",
1605
+ "lstrip": false,
1606
+ "normalized": false,
1607
+ "rstrip": false,
1608
+ "single_word": false,
1609
+ "special": true
1610
+ },
1611
+ "128201": {
1612
+ "content": "<|reserved_special_token_192|>",
1613
+ "lstrip": false,
1614
+ "normalized": false,
1615
+ "rstrip": false,
1616
+ "single_word": false,
1617
+ "special": true
1618
+ },
1619
+ "128202": {
1620
+ "content": "<|reserved_special_token_193|>",
1621
+ "lstrip": false,
1622
+ "normalized": false,
1623
+ "rstrip": false,
1624
+ "single_word": false,
1625
+ "special": true
1626
+ },
1627
+ "128203": {
1628
+ "content": "<|reserved_special_token_194|>",
1629
+ "lstrip": false,
1630
+ "normalized": false,
1631
+ "rstrip": false,
1632
+ "single_word": false,
1633
+ "special": true
1634
+ },
1635
+ "128204": {
1636
+ "content": "<|reserved_special_token_195|>",
1637
+ "lstrip": false,
1638
+ "normalized": false,
1639
+ "rstrip": false,
1640
+ "single_word": false,
1641
+ "special": true
1642
+ },
1643
+ "128205": {
1644
+ "content": "<|reserved_special_token_196|>",
1645
+ "lstrip": false,
1646
+ "normalized": false,
1647
+ "rstrip": false,
1648
+ "single_word": false,
1649
+ "special": true
1650
+ },
1651
+ "128206": {
1652
+ "content": "<|reserved_special_token_197|>",
1653
+ "lstrip": false,
1654
+ "normalized": false,
1655
+ "rstrip": false,
1656
+ "single_word": false,
1657
+ "special": true
1658
+ },
1659
+ "128207": {
1660
+ "content": "<|reserved_special_token_198|>",
1661
+ "lstrip": false,
1662
+ "normalized": false,
1663
+ "rstrip": false,
1664
+ "single_word": false,
1665
+ "special": true
1666
+ },
1667
+ "128208": {
1668
+ "content": "<|reserved_special_token_199|>",
1669
+ "lstrip": false,
1670
+ "normalized": false,
1671
+ "rstrip": false,
1672
+ "single_word": false,
1673
+ "special": true
1674
+ },
1675
+ "128209": {
1676
+ "content": "<|reserved_special_token_200|>",
1677
+ "lstrip": false,
1678
+ "normalized": false,
1679
+ "rstrip": false,
1680
+ "single_word": false,
1681
+ "special": true
1682
+ },
1683
+ "128210": {
1684
+ "content": "<|reserved_special_token_201|>",
1685
+ "lstrip": false,
1686
+ "normalized": false,
1687
+ "rstrip": false,
1688
+ "single_word": false,
1689
+ "special": true
1690
+ },
1691
+ "128211": {
1692
+ "content": "<|reserved_special_token_202|>",
1693
+ "lstrip": false,
1694
+ "normalized": false,
1695
+ "rstrip": false,
1696
+ "single_word": false,
1697
+ "special": true
1698
+ },
1699
+ "128212": {
1700
+ "content": "<|reserved_special_token_203|>",
1701
+ "lstrip": false,
1702
+ "normalized": false,
1703
+ "rstrip": false,
1704
+ "single_word": false,
1705
+ "special": true
1706
+ },
1707
+ "128213": {
1708
+ "content": "<|reserved_special_token_204|>",
1709
+ "lstrip": false,
1710
+ "normalized": false,
1711
+ "rstrip": false,
1712
+ "single_word": false,
1713
+ "special": true
1714
+ },
1715
+ "128214": {
1716
+ "content": "<|reserved_special_token_205|>",
1717
+ "lstrip": false,
1718
+ "normalized": false,
1719
+ "rstrip": false,
1720
+ "single_word": false,
1721
+ "special": true
1722
+ },
1723
+ "128215": {
1724
+ "content": "<|reserved_special_token_206|>",
1725
+ "lstrip": false,
1726
+ "normalized": false,
1727
+ "rstrip": false,
1728
+ "single_word": false,
1729
+ "special": true
1730
+ },
1731
+ "128216": {
1732
+ "content": "<|reserved_special_token_207|>",
1733
+ "lstrip": false,
1734
+ "normalized": false,
1735
+ "rstrip": false,
1736
+ "single_word": false,
1737
+ "special": true
1738
+ },
1739
+ "128217": {
1740
+ "content": "<|reserved_special_token_208|>",
1741
+ "lstrip": false,
1742
+ "normalized": false,
1743
+ "rstrip": false,
1744
+ "single_word": false,
1745
+ "special": true
1746
+ },
1747
+ "128218": {
1748
+ "content": "<|reserved_special_token_209|>",
1749
+ "lstrip": false,
1750
+ "normalized": false,
1751
+ "rstrip": false,
1752
+ "single_word": false,
1753
+ "special": true
1754
+ },
1755
+ "128219": {
1756
+ "content": "<|reserved_special_token_210|>",
1757
+ "lstrip": false,
1758
+ "normalized": false,
1759
+ "rstrip": false,
1760
+ "single_word": false,
1761
+ "special": true
1762
+ },
1763
+ "128220": {
1764
+ "content": "<|reserved_special_token_211|>",
1765
+ "lstrip": false,
1766
+ "normalized": false,
1767
+ "rstrip": false,
1768
+ "single_word": false,
1769
+ "special": true
1770
+ },
1771
+ "128221": {
1772
+ "content": "<|reserved_special_token_212|>",
1773
+ "lstrip": false,
1774
+ "normalized": false,
1775
+ "rstrip": false,
1776
+ "single_word": false,
1777
+ "special": true
1778
+ },
1779
+ "128222": {
1780
+ "content": "<|reserved_special_token_213|>",
1781
+ "lstrip": false,
1782
+ "normalized": false,
1783
+ "rstrip": false,
1784
+ "single_word": false,
1785
+ "special": true
1786
+ },
1787
+ "128223": {
1788
+ "content": "<|reserved_special_token_214|>",
1789
+ "lstrip": false,
1790
+ "normalized": false,
1791
+ "rstrip": false,
1792
+ "single_word": false,
1793
+ "special": true
1794
+ },
1795
+ "128224": {
1796
+ "content": "<|reserved_special_token_215|>",
1797
+ "lstrip": false,
1798
+ "normalized": false,
1799
+ "rstrip": false,
1800
+ "single_word": false,
1801
+ "special": true
1802
+ },
1803
+ "128225": {
1804
+ "content": "<|reserved_special_token_216|>",
1805
+ "lstrip": false,
1806
+ "normalized": false,
1807
+ "rstrip": false,
1808
+ "single_word": false,
1809
+ "special": true
1810
+ },
1811
+ "128226": {
1812
+ "content": "<|reserved_special_token_217|>",
1813
+ "lstrip": false,
1814
+ "normalized": false,
1815
+ "rstrip": false,
1816
+ "single_word": false,
1817
+ "special": true
1818
+ },
1819
+ "128227": {
1820
+ "content": "<|reserved_special_token_218|>",
1821
+ "lstrip": false,
1822
+ "normalized": false,
1823
+ "rstrip": false,
1824
+ "single_word": false,
1825
+ "special": true
1826
+ },
1827
+ "128228": {
1828
+ "content": "<|reserved_special_token_219|>",
1829
+ "lstrip": false,
1830
+ "normalized": false,
1831
+ "rstrip": false,
1832
+ "single_word": false,
1833
+ "special": true
1834
+ },
1835
+ "128229": {
1836
+ "content": "<|reserved_special_token_220|>",
1837
+ "lstrip": false,
1838
+ "normalized": false,
1839
+ "rstrip": false,
1840
+ "single_word": false,
1841
+ "special": true
1842
+ },
1843
+ "128230": {
1844
+ "content": "<|reserved_special_token_221|>",
1845
+ "lstrip": false,
1846
+ "normalized": false,
1847
+ "rstrip": false,
1848
+ "single_word": false,
1849
+ "special": true
1850
+ },
1851
+ "128231": {
1852
+ "content": "<|reserved_special_token_222|>",
1853
+ "lstrip": false,
1854
+ "normalized": false,
1855
+ "rstrip": false,
1856
+ "single_word": false,
1857
+ "special": true
1858
+ },
1859
+ "128232": {
1860
+ "content": "<|reserved_special_token_223|>",
1861
+ "lstrip": false,
1862
+ "normalized": false,
1863
+ "rstrip": false,
1864
+ "single_word": false,
1865
+ "special": true
1866
+ },
1867
+ "128233": {
1868
+ "content": "<|reserved_special_token_224|>",
1869
+ "lstrip": false,
1870
+ "normalized": false,
1871
+ "rstrip": false,
1872
+ "single_word": false,
1873
+ "special": true
1874
+ },
1875
+ "128234": {
1876
+ "content": "<|reserved_special_token_225|>",
1877
+ "lstrip": false,
1878
+ "normalized": false,
1879
+ "rstrip": false,
1880
+ "single_word": false,
1881
+ "special": true
1882
+ },
1883
+ "128235": {
1884
+ "content": "<|reserved_special_token_226|>",
1885
+ "lstrip": false,
1886
+ "normalized": false,
1887
+ "rstrip": false,
1888
+ "single_word": false,
1889
+ "special": true
1890
+ },
1891
+ "128236": {
1892
+ "content": "<|reserved_special_token_227|>",
1893
+ "lstrip": false,
1894
+ "normalized": false,
1895
+ "rstrip": false,
1896
+ "single_word": false,
1897
+ "special": true
1898
+ },
1899
+ "128237": {
1900
+ "content": "<|reserved_special_token_228|>",
1901
+ "lstrip": false,
1902
+ "normalized": false,
1903
+ "rstrip": false,
1904
+ "single_word": false,
1905
+ "special": true
1906
+ },
1907
+ "128238": {
1908
+ "content": "<|reserved_special_token_229|>",
1909
+ "lstrip": false,
1910
+ "normalized": false,
1911
+ "rstrip": false,
1912
+ "single_word": false,
1913
+ "special": true
1914
+ },
1915
+ "128239": {
1916
+ "content": "<|reserved_special_token_230|>",
1917
+ "lstrip": false,
1918
+ "normalized": false,
1919
+ "rstrip": false,
1920
+ "single_word": false,
1921
+ "special": true
1922
+ },
1923
+ "128240": {
1924
+ "content": "<|reserved_special_token_231|>",
1925
+ "lstrip": false,
1926
+ "normalized": false,
1927
+ "rstrip": false,
1928
+ "single_word": false,
1929
+ "special": true
1930
+ },
1931
+ "128241": {
1932
+ "content": "<|reserved_special_token_232|>",
1933
+ "lstrip": false,
1934
+ "normalized": false,
1935
+ "rstrip": false,
1936
+ "single_word": false,
1937
+ "special": true
1938
+ },
1939
+ "128242": {
1940
+ "content": "<|reserved_special_token_233|>",
1941
+ "lstrip": false,
1942
+ "normalized": false,
1943
+ "rstrip": false,
1944
+ "single_word": false,
1945
+ "special": true
1946
+ },
1947
+ "128243": {
1948
+ "content": "<|reserved_special_token_234|>",
1949
+ "lstrip": false,
1950
+ "normalized": false,
1951
+ "rstrip": false,
1952
+ "single_word": false,
1953
+ "special": true
1954
+ },
1955
+ "128244": {
1956
+ "content": "<|reserved_special_token_235|>",
1957
+ "lstrip": false,
1958
+ "normalized": false,
1959
+ "rstrip": false,
1960
+ "single_word": false,
1961
+ "special": true
1962
+ },
1963
+ "128245": {
1964
+ "content": "<|reserved_special_token_236|>",
1965
+ "lstrip": false,
1966
+ "normalized": false,
1967
+ "rstrip": false,
1968
+ "single_word": false,
1969
+ "special": true
1970
+ },
1971
+ "128246": {
1972
+ "content": "<|reserved_special_token_237|>",
1973
+ "lstrip": false,
1974
+ "normalized": false,
1975
+ "rstrip": false,
1976
+ "single_word": false,
1977
+ "special": true
1978
+ },
1979
+ "128247": {
1980
+ "content": "<|reserved_special_token_238|>",
1981
+ "lstrip": false,
1982
+ "normalized": false,
1983
+ "rstrip": false,
1984
+ "single_word": false,
1985
+ "special": true
1986
+ },
1987
+ "128248": {
1988
+ "content": "<|reserved_special_token_239|>",
1989
+ "lstrip": false,
1990
+ "normalized": false,
1991
+ "rstrip": false,
1992
+ "single_word": false,
1993
+ "special": true
1994
+ },
1995
+ "128249": {
1996
+ "content": "<|reserved_special_token_240|>",
1997
+ "lstrip": false,
1998
+ "normalized": false,
1999
+ "rstrip": false,
2000
+ "single_word": false,
2001
+ "special": true
2002
+ },
2003
+ "128250": {
2004
+ "content": "<|reserved_special_token_241|>",
2005
+ "lstrip": false,
2006
+ "normalized": false,
2007
+ "rstrip": false,
2008
+ "single_word": false,
2009
+ "special": true
2010
+ },
2011
+ "128251": {
2012
+ "content": "<|reserved_special_token_242|>",
2013
+ "lstrip": false,
2014
+ "normalized": false,
2015
+ "rstrip": false,
2016
+ "single_word": false,
2017
+ "special": true
2018
+ },
2019
+ "128252": {
2020
+ "content": "<|reserved_special_token_243|>",
2021
+ "lstrip": false,
2022
+ "normalized": false,
2023
+ "rstrip": false,
2024
+ "single_word": false,
2025
+ "special": true
2026
+ },
2027
+ "128253": {
2028
+ "content": "<|reserved_special_token_244|>",
2029
+ "lstrip": false,
2030
+ "normalized": false,
2031
+ "rstrip": false,
2032
+ "single_word": false,
2033
+ "special": true
2034
+ },
2035
+ "128254": {
2036
+ "content": "<|video|>",
2037
+ "lstrip": false,
2038
+ "normalized": false,
2039
+ "rstrip": false,
2040
+ "single_word": false,
2041
+ "special": true
2042
+ },
2043
+ "128255": {
2044
+ "content": "<|reserved_special_token_246|>",
2045
+ "lstrip": false,
2046
+ "normalized": false,
2047
+ "rstrip": false,
2048
+ "single_word": false,
2049
+ "special": true
2050
+ },
2051
+ "128256": {
2052
+ "content": "<|image|>",
2053
+ "lstrip": false,
2054
+ "normalized": false,
2055
+ "rstrip": false,
2056
+ "single_word": false,
2057
+ "special": true
2058
+ },
2059
+ "128257": {
2060
+ "content": "<|reserved_special_token_245|>",
2061
+ "lstrip": false,
2062
+ "normalized": false,
2063
+ "rstrip": false,
2064
+ "single_word": false,
2065
+ "special": true
2066
+ }
2067
+ },
2068
+ "bos_token": "<|begin_of_text|>",
2069
+ "chat_template": "{{- bos_token }}\n{%- if custom_tools is defined %}\n {%- set tools = custom_tools %}\n{%- endif %}\n{%- if not tools_in_user_message is defined %}\n {%- set tools_in_user_message = true %}\n{%- endif %}\n{%- if not date_string is defined %}\n {%- if strftime_now is defined %}\n {%- set date_string = strftime_now(\"%d %b %Y\") %}\n {%- else %}\n {%- set date_string = \"26 Jul 2024\" %}\n {%- endif %}\n{%- endif %}\n{%- if not tools is defined %}\n {%- set tools = none %}\n{%- endif %}\n\n{#- This block extracts the system message. #}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n {%- set user_supplied_system_message = true %}\n{%- else %}\n {%- set system_message = none %}\n {%- set user_supplied_system_message = false %}\n{%- endif %}\n\n{#- Find out if there are any images, not used here but kept for consistency #}\n{% set image_ns = namespace(has_images=false) %}\n{%- for message in messages %}\n {%- if message['content'] is iterable and message['content'] is not string %}\n {%- for content in message['content'] %}\n {%- if content['type'] == 'image' %}\n {%- set image_ns.has_images = true %}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n\n{#- System message printing logic: This block now ensures complete replacement. #}\n{{- \"<|start_header_id|>system<|end_header_id|>\\n\\n\" }}\n{%- if user_supplied_system_message %}\n {{- system_message }}\n{%- else %}\n {{- \"You are a helpful AI assistant. Respond to the user's request based on the provided text and/or images.\" }}\n{%- endif %}\n{{- \"<|eot_id|>\" }}\n\n{#- Custom tools are passed in a user message with some extra guidance #}\n{%- if tools_in_user_message and not tools is none %}\n {#- Extract the first user message so we can plug it in here #}\n {%- if messages | length != 0 %}\n {%- set first_user_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n {%- else %}\n {{- raise_exception(\"Cannot put tools in the first user message when there's no first user message!\") }}\n {%- endif %}\n {{- '<|start_header_id|>user<|end_header_id|>\\n\\n' -}}\n {{- \"Given the following functions, please respond with a JSON for a function call \" }}\n {{- \"with its proper arguments that best answers the given prompt.\\n\\n\" }}\n {{- 'Respond in the format {\\\"name\\\": function name, \\\"parameters\\\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n {{- first_user_message + \"<|eot_id|>\"}}\n{%- endif %}\n\n{%- for message in messages %}\n {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\\n\\n' }}\n {%- if message['content'] is string %}\n {{- message['content'] }}\n {%- else %}\n {%- for content in message['content'] %}\n {%- if content['type'] == 'image' %}\n {{- '<|image|>' }}\n {%- elif content['type'] == 'video' %}\n {{- '<|video|>' }}\n {%- elif content['type'] == 'text' %}\n {{- content['text'] }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|eot_id|>' }}\n {%- elif 'tool_calls' in message %}\n {%- if not message.tool_calls|length == 1 %}\n {{- raise_exception(\"This model only supports single tool-calls at once!\") }}\n {%- endif %}\n {%- set tool_call = message.tool_calls[0].function %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- '{\\\"name\\\": \\\"' + tool_call.name + '\\\", ' }}\n {{- '\\\"parameters\\\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- \"}\" }}\n {{- \"<|eot_id|>\" }}\n {%- elif message.role == \"tool\" or message.role == \"ipython\" %}\n {{- \"<|start_header_id|>ipython<|end_header_id|>\\n\\n\" }}\n {%- if message.content is mapping or message.content is iterable %}\n {{- message.content | tojson }}\n {%- else %}\n {{- message.content }}\n {%- endif %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' }}\n{%- endif %}\n",
2070
+ "clean_up_tokenization_spaces": true,
2071
+ "eos_token": "<|eot_id|>",
2072
+ "extra_special_tokens": {},
2073
+ "model_input_names": [
2074
+ "input_ids",
2075
+ "attention_mask"
2076
+ ],
2077
+ "model_max_length": 131072,
2078
+ "pad_token": "<|finetune_right_pad_id|>",
2079
+ "padding_side": "right",
2080
+ "split_special_tokens": false,
2081
+ "tokenizer_class": "PreTrainedTokenizerFast"
2082
+ }