runninglsy
commited on
Commit
•
a2db297
1
Parent(s):
90bcff8
initial commit
Browse files- README.md +94 -3
- added_tokens.json +5 -0
- base_visual_tokenizer.py +138 -0
- clip_visual_tokenizer.py +120 -0
- config.json +245 -0
- configuration_ovis.py +35 -0
- conversation_formatter.py +190 -0
- generation_config.json +15 -0
- merges.txt +0 -0
- modeling_ovis.py +289 -0
- preprocessor_config.json +44 -0
- pytorch_model-00001-of-00004.bin +3 -0
- pytorch_model-00002-of-00004.bin +3 -0
- pytorch_model-00003-of-00004.bin +3 -0
- pytorch_model-00004-of-00004.bin +3 -0
- pytorch_model.bin.index.json +789 -0
- special_tokens_map.json +20 -0
- tokenizer.json +0 -0
- tokenizer_config.json +43 -0
- utils.py +35 -0
- visual_tokenizer.py +254 -0
- vocab.json +0 -0
README.md
CHANGED
@@ -1,3 +1,94 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- AIDC-AI/Ovis-dataset
|
5 |
+
library_name: transformers
|
6 |
+
tags:
|
7 |
+
- MLLM
|
8 |
+
---
|
9 |
+
|
10 |
+
## Introduction
|
11 |
+
Ovis is a novel Multimodal Large Language Model (MLLM) architecture, designed to structurally align visual and textual embeddings. For a comprehensive introduction, please refer to [Ovis paper](https://arxiv.org/abs/2405.20797) and [Ovis GitHub](https://github.com/AIDC-AI/Ovis).
|
12 |
+
|
13 |
+
## Model
|
14 |
+
Ovis can be instantiated with popular LLMs (e.g., Qwen, Llama3). We provide the following pretrained Ovis MLLMs:
|
15 |
+
|
16 |
+
| | Ovis-Clip-Qwen1.5-7B | Ovis-Clip-Llama3-8B | Ovis-Clip-Qwen1.5-14B |
|
17 |
+
|:---------------|-------------------------------------------------------------------:|------------------------------------------------------------------:|--------------------------------------------------------------------:|
|
18 |
+
| ViT | Clip | Clip | Clip |
|
19 |
+
| LLM | Qwen1.5-7B-Chat | Llama3-8B-Instruct | Qwen1.5-14B-Chat |
|
20 |
+
| Download | [Huggingface](https://huggingface.co/AIDC-AI/Ovis-Clip-Qwen1_5-7B) | [Huggingface](https://huggingface.co/AIDC-AI/Ovis-Clip-Llama3-8B) | [Huggingface](https://huggingface.co/AIDC-AI/Ovis-Clip-Qwen1_5-14B) |
|
21 |
+
| MMStar | 44.3 | 49.5 | 48.5 |
|
22 |
+
| MMB-EN | 75.1 | 77.4 | 78.4 |
|
23 |
+
| MMB-CN | 70.2 | 72.8 | 76.6 |
|
24 |
+
| MMMU-Val | 39.7 | 44.7 | 46.7 |
|
25 |
+
| MMMU-Test | 37.7 | 39.0 | 40.7 |
|
26 |
+
| MathVista-Mini | 41.4 | 40.8 | 43.4 |
|
27 |
+
| MME | 1882 | 2009 | 1961 |
|
28 |
+
| HallusionBench | 56.4 | 61.1 | 57.6 |
|
29 |
+
| RealWorldQA | 60.0 | 57.9 | 62.7 |
|
30 |
+
|
31 |
+
## Usage
|
32 |
+
Below is a code snippet to run Ovis with multimodal inputs. For additional usage instructions, including inference wrapper and Gradio UI, please refer to [Ovis GitHub](https://github.com/AIDC-AI/Ovis).
|
33 |
+
```bash
|
34 |
+
pip install torch==2.1.0 transformers==4.41.1 deepspeed==0.14.0 pillow==10.3.0
|
35 |
+
```
|
36 |
+
```python
|
37 |
+
import torch
|
38 |
+
from PIL import Image
|
39 |
+
from transformers import AutoModelForCausalLM
|
40 |
+
|
41 |
+
# load model
|
42 |
+
model = AutoModelForCausalLM.from_pretrained("AIDC-AI/Ovis-Clip-Qwen1_5-7B",
|
43 |
+
torch_dtype=torch.bfloat16,
|
44 |
+
multimodal_max_length=8192,
|
45 |
+
trust_remote_code=True).cuda()
|
46 |
+
text_tokenizer = model.get_text_tokenizer()
|
47 |
+
visual_tokenizer = model.get_visual_tokenizer()
|
48 |
+
conversation_formatter = model.get_conversation_formatter()
|
49 |
+
|
50 |
+
# enter image path and prompt
|
51 |
+
image_path = input("Enter image path: ")
|
52 |
+
image = Image.open(image_path)
|
53 |
+
text = input("Enter prompt: ")
|
54 |
+
query = f'<image> {text}'
|
55 |
+
prompt, input_ids = conversation_formatter.format_query(query)
|
56 |
+
input_ids = torch.unsqueeze(input_ids, dim=0).to(device=model.device)
|
57 |
+
attention_mask = torch.ne(input_ids, text_tokenizer.pad_token_id).to(device=model.device)
|
58 |
+
pixel_values = [visual_tokenizer.preprocess_image(image).to(
|
59 |
+
dtype=visual_tokenizer.dtype, device=visual_tokenizer.device)]
|
60 |
+
|
61 |
+
# print model output
|
62 |
+
with torch.inference_mode():
|
63 |
+
kwargs = dict(
|
64 |
+
pixel_values=pixel_values,
|
65 |
+
attention_mask=attention_mask,
|
66 |
+
do_sample=False,
|
67 |
+
top_p=None,
|
68 |
+
temperature=None,
|
69 |
+
top_k=None,
|
70 |
+
repetition_penalty=None,
|
71 |
+
max_new_tokens=512,
|
72 |
+
use_cache=True,
|
73 |
+
eos_token_id=text_tokenizer.eos_token_id,
|
74 |
+
pad_token_id=text_tokenizer.pad_token_id
|
75 |
+
)
|
76 |
+
output_ids = model.generate(input_ids, **kwargs)[0]
|
77 |
+
input_token_len = input_ids.shape[1]
|
78 |
+
output = text_tokenizer.decode(output_ids[input_token_len:], skip_special_tokens=True)
|
79 |
+
print(f'Output: {output}')
|
80 |
+
```
|
81 |
+
|
82 |
+
## Citation
|
83 |
+
If you find Ovis useful, please cite the paper
|
84 |
+
```
|
85 |
+
@article{lu2024ovis,
|
86 |
+
title={Ovis: Structural Embedding Alignment for Multimodal Large Language Model},
|
87 |
+
author={Shiyin Lu and Yang Li and Qing-Guo Chen and Zhao Xu and Weihua Luo and Kaifu Zhang and Han-Jia Ye},
|
88 |
+
year={2024},
|
89 |
+
journal={arXiv:2405.20797}
|
90 |
+
}
|
91 |
+
```
|
92 |
+
|
93 |
+
## License
|
94 |
+
The project is licensed under the Apache 2.0 License and is restricted to uses that comply with the license agreements of Qwen, Llama3, and Clip.
|
added_tokens.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<|endoftext|>": 151643,
|
3 |
+
"<|im_end|>": 151645,
|
4 |
+
"<|im_start|>": 151644
|
5 |
+
}
|
base_visual_tokenizer.py
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Union, Optional
|
2 |
+
|
3 |
+
import PIL.Image
|
4 |
+
import torch
|
5 |
+
from torch.nn.functional import softmax, gumbel_softmax
|
6 |
+
from transformers import PretrainedConfig, PreTrainedModel, AutoImageProcessor, AutoModel, AutoConfig
|
7 |
+
|
8 |
+
|
9 |
+
class BaseVisualTokenizerConfig(PretrainedConfig):
|
10 |
+
def __init__(self,
|
11 |
+
vocab_size=16384,
|
12 |
+
tokenize_function="softmax",
|
13 |
+
tau=1.0,
|
14 |
+
depths=None,
|
15 |
+
use_indicators=False,
|
16 |
+
drop_cls_token=False,
|
17 |
+
backbone_config: Optional[Union[PretrainedConfig, dict]] = None,
|
18 |
+
hidden_stride: int = 1,
|
19 |
+
**kwargs):
|
20 |
+
super().__init__(**kwargs)
|
21 |
+
self.vocab_size = vocab_size
|
22 |
+
self.tokenize_function = tokenize_function
|
23 |
+
self.tau = tau
|
24 |
+
if isinstance(depths, str):
|
25 |
+
depths = [int(x) for x in depths.split('|')]
|
26 |
+
self.depths = depths
|
27 |
+
self.backbone_kwargs = {}
|
28 |
+
self.use_indicators = use_indicators
|
29 |
+
self.drop_cls_token = drop_cls_token
|
30 |
+
if backbone_config is not None:
|
31 |
+
assert isinstance(backbone_config, (PretrainedConfig, dict)), \
|
32 |
+
f"expect `backbone_config` to be instance of PretrainedConfig or dict, but got {type(backbone_config)} type"
|
33 |
+
if not isinstance(backbone_config, PretrainedConfig):
|
34 |
+
model_type = backbone_config['model_type']
|
35 |
+
backbone_config.pop('model_type')
|
36 |
+
backbone_config = AutoConfig.for_model(model_type, **backbone_config)
|
37 |
+
self.backbone_config = backbone_config
|
38 |
+
self.hidden_stride = hidden_stride
|
39 |
+
|
40 |
+
|
41 |
+
class BaseVisualTokenizer(PreTrainedModel):
|
42 |
+
base_model_prefix = "backbone"
|
43 |
+
main_input_name = None
|
44 |
+
_image_processor_class = None
|
45 |
+
_image_processor_kwargs = {}
|
46 |
+
_backbone_class = None
|
47 |
+
_backbone_name_or_path = None
|
48 |
+
|
49 |
+
def __init__(self, config: BaseVisualTokenizerConfig, *inputs, **kwargs):
|
50 |
+
super().__init__(config, *inputs, **kwargs)
|
51 |
+
if kwargs.get('train_from_scratch'):
|
52 |
+
self.image_processor = self._image_processor_class.from_pretrained(self._backbone_name_or_path,
|
53 |
+
**self._image_processor_kwargs)
|
54 |
+
self.backbone = self._backbone_class.from_pretrained(self._backbone_name_or_path,
|
55 |
+
**self.config.backbone_kwargs)
|
56 |
+
self.config.backbone_config = self.backbone.config
|
57 |
+
else:
|
58 |
+
self.image_processor = AutoImageProcessor.from_pretrained(kwargs['image_processor_name_or_path'])
|
59 |
+
self.backbone = AutoModel.from_config(self.config.backbone_config)
|
60 |
+
self.head = None
|
61 |
+
|
62 |
+
assert all((self.image_processor.do_resize,
|
63 |
+
not getattr(self.image_processor, 'do_center_crop', False),
|
64 |
+
self.image_processor.do_rescale,
|
65 |
+
self.image_processor.do_normalize
|
66 |
+
)), f"image_processor `{self.image_processor}` is not supported currently"
|
67 |
+
|
68 |
+
def get_backbone(self):
|
69 |
+
return self.backbone
|
70 |
+
|
71 |
+
def get_monitor_tensors(self):
|
72 |
+
raise NotImplementedError
|
73 |
+
|
74 |
+
def get_image_processor(self):
|
75 |
+
return self.image_processor
|
76 |
+
|
77 |
+
def get_head(self):
|
78 |
+
return self.head
|
79 |
+
|
80 |
+
def get_image_size(self):
|
81 |
+
raise NotImplementedError
|
82 |
+
|
83 |
+
def preprocess_image(self, image: PIL.Image.Image, convert_to_rgb=True):
|
84 |
+
if convert_to_rgb and image.mode != 'RGB':
|
85 |
+
image = image.convert('RGB')
|
86 |
+
|
87 |
+
# first resize and preprocess
|
88 |
+
sides = self.get_image_size()
|
89 |
+
if sides[0] != sides[1]:
|
90 |
+
raise ValueError('get_image_size() returns non-square size')
|
91 |
+
side = sides[0]
|
92 |
+
|
93 |
+
width, height = image.size
|
94 |
+
if width == height:
|
95 |
+
new_width = new_height = side
|
96 |
+
elif width > height:
|
97 |
+
new_width = side
|
98 |
+
new_height = int(height / width * new_width)
|
99 |
+
else:
|
100 |
+
new_height = side
|
101 |
+
new_width = int(width / height * new_height)
|
102 |
+
new_size = dict(height=new_height, width=new_width)
|
103 |
+
pixel_values = self.image_processor.preprocess(image, size=new_size, return_tensors='pt')['pixel_values']
|
104 |
+
|
105 |
+
# then pad to square
|
106 |
+
square_values = torch.zeros([1, 3, side, side], dtype=pixel_values.dtype, device=pixel_values.device)
|
107 |
+
new_height, new_width = pixel_values.shape[2:]
|
108 |
+
if new_height == new_width:
|
109 |
+
square_values[:, :, :, :] = pixel_values
|
110 |
+
elif new_height > new_width:
|
111 |
+
from_index = (side - new_width) // 2
|
112 |
+
square_values[:, :, :, from_index:from_index + new_width] = pixel_values
|
113 |
+
else:
|
114 |
+
from_index = (side - new_height) // 2
|
115 |
+
square_values[:, :, from_index:from_index + new_height, :] = pixel_values
|
116 |
+
|
117 |
+
return square_values
|
118 |
+
|
119 |
+
def get_layer_norm(self):
|
120 |
+
return self.layer_norm
|
121 |
+
|
122 |
+
def tokenize(self, logits):
|
123 |
+
def st_argmax(y_soft, dim): # straight-through softmax
|
124 |
+
index = y_soft.max(dim, keepdim=True)[1]
|
125 |
+
y_hard = torch.zeros_like(y_soft, memory_format=torch.legacy_contiguous_format).scatter_(dim, index, 1.0)
|
126 |
+
ret = y_hard - y_soft.detach() + y_soft
|
127 |
+
return ret
|
128 |
+
|
129 |
+
if self.config.tokenize_function == 'softmax':
|
130 |
+
tokens = softmax(logits, dim=-1)
|
131 |
+
elif self.config.tokenize_function == 'gumbel_argmax':
|
132 |
+
tokens = gumbel_softmax(logits, tau=self.config.tau, hard=True)
|
133 |
+
elif self.config.tokenize_function == 'st_argmax':
|
134 |
+
tokens = st_argmax(logits, dim=-1)
|
135 |
+
else:
|
136 |
+
raise ValueError(
|
137 |
+
f'Invalid `max_type`, expected softmax or gumbel_argmax or st_argmax, but got {self.config.tokenize_function}')
|
138 |
+
return tokens
|
clip_visual_tokenizer.py
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datetime import datetime
|
2 |
+
from typing import Dict
|
3 |
+
|
4 |
+
import deepspeed
|
5 |
+
import torch
|
6 |
+
from torch import Tensor
|
7 |
+
from transformers import AutoConfig, AutoModel
|
8 |
+
from transformers import CLIPVisionModel, CLIPImageProcessor
|
9 |
+
from transformers.integrations import is_deepspeed_zero3_enabled
|
10 |
+
|
11 |
+
from .utils import BEGIN_LINE, END_LINE, rank0_print
|
12 |
+
from .base_visual_tokenizer import BaseVisualTokenizerConfig, BaseVisualTokenizer
|
13 |
+
|
14 |
+
MODEL_TYPE = "clip_visual_tokenizer"
|
15 |
+
|
16 |
+
|
17 |
+
class ClipVisualTokenizerConfig(BaseVisualTokenizerConfig):
|
18 |
+
model_type = MODEL_TYPE
|
19 |
+
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
if self.depths:
|
23 |
+
assert len(self.depths) == 1
|
24 |
+
self.backbone_kwargs['num_hidden_layers'] = self.depths[0]
|
25 |
+
|
26 |
+
|
27 |
+
class ClipVisualTokenizer(BaseVisualTokenizer):
|
28 |
+
config_class = ClipVisualTokenizerConfig
|
29 |
+
supports_gradient_checkpointing = True
|
30 |
+
_no_split_modules = ["CLIPEncoderLayer"]
|
31 |
+
_image_processor_class = CLIPImageProcessor
|
32 |
+
_image_processor_kwargs = dict(do_center_crop=False)
|
33 |
+
_backbone_class = CLIPVisionModel
|
34 |
+
_backbone_name_or_path = "openai/clip-vit-large-patch14-336"
|
35 |
+
|
36 |
+
def __init__(self, config: ClipVisualTokenizerConfig = None, *inputs, **kwargs):
|
37 |
+
super().__init__(config, *inputs, **kwargs)
|
38 |
+
head_dim = self.config.vocab_size
|
39 |
+
if self.config.use_indicators:
|
40 |
+
head_dim -= 2 # reserved for two image indicator tokens
|
41 |
+
self.head = torch.nn.Sequential(
|
42 |
+
torch.nn.Linear(self.backbone.config.hidden_size, head_dim, bias=False),
|
43 |
+
torch.nn.LayerNorm(head_dim)
|
44 |
+
)
|
45 |
+
|
46 |
+
def re_init_layers(self, re_init_layer_begin):
|
47 |
+
layer_dict = self.get_re_init_layer_dict(re_init_layer_begin)
|
48 |
+
for name, layer in layer_dict.items():
|
49 |
+
rank0_print(BEGIN_LINE)
|
50 |
+
rank0_print(f'[{datetime.now()}] Before layer re-initialization of {name}: ')
|
51 |
+
for k, v in layer.named_parameters():
|
52 |
+
with deepspeed.zero.GatheredParameters([v]):
|
53 |
+
rank0_print(f'{k}: {v}')
|
54 |
+
with deepspeed.zero.GatheredParameters(list(layer.parameters(recurse=True)), modifier_rank=0):
|
55 |
+
if not is_deepspeed_zero3_enabled() or deepspeed.comm.get_rank() == 0:
|
56 |
+
layer.apply(self.backbone._init_weights)
|
57 |
+
rank0_print(f'[{datetime.now()}] After layer re-initialization of {name}:')
|
58 |
+
for k, v in layer.named_parameters():
|
59 |
+
with deepspeed.zero.GatheredParameters([v]):
|
60 |
+
rank0_print(f'{k}: {v}')
|
61 |
+
rank0_print(END_LINE)
|
62 |
+
|
63 |
+
def get_re_init_layer_dict(self, re_init_layer_begin: int) -> Dict[str, torch.nn.Module]:
|
64 |
+
assert re_init_layer_begin >= 0, "negative index is prohibited"
|
65 |
+
layer_dict = dict()
|
66 |
+
for i in range(re_init_layer_begin, self.backbone.config.num_hidden_layers):
|
67 |
+
layer_dict[f'backbone.vision_model.encoder.layers.{i}'] = self.backbone.vision_model.encoder.layers[i]
|
68 |
+
return layer_dict
|
69 |
+
|
70 |
+
def get_monitor_tensors(self):
|
71 |
+
return dict(
|
72 |
+
backbone_bottom=self.backbone.vision_model.encoder.layers[0].self_attn.k_proj.weight,
|
73 |
+
backbone_top=self.backbone.vision_model.encoder.layers[-1].self_attn.out_proj.weight,
|
74 |
+
head=self.head[0].weight
|
75 |
+
)
|
76 |
+
|
77 |
+
def get_image_size(self):
|
78 |
+
height = self.image_processor.crop_size["height"]
|
79 |
+
width = self.image_processor.crop_size["width"]
|
80 |
+
return height, width
|
81 |
+
|
82 |
+
def forward(self, pixel_values) -> Tensor: # [BatchSize, ImageShape] -> [BatchSize, #Token, VocabSize]
|
83 |
+
output = self.backbone(
|
84 |
+
pixel_values, output_hidden_states=True, return_dict=True)
|
85 |
+
features = output.last_hidden_state
|
86 |
+
if self.config.drop_cls_token:
|
87 |
+
features = features[:, 1:, :]
|
88 |
+
logits = self.head(features)
|
89 |
+
tokens = self.tokenize(logits)
|
90 |
+
if self.config.use_indicators:
|
91 |
+
# tokens' shape is [BatchSize, #Token, VocabSize-2], so padding with [BatchSize, #Token, 2], after
|
92 |
+
# which, tokens' shape should become [BatchSize, #Token, VocabSize]
|
93 |
+
batch_size, token_len, _ = tokens.shape
|
94 |
+
padding_tensor = torch.zeros(size=(batch_size, token_len, 2),
|
95 |
+
dtype=tokens.dtype,
|
96 |
+
device=tokens.device,
|
97 |
+
layout=tokens.layout,
|
98 |
+
requires_grad=False)
|
99 |
+
tokens = torch.cat((tokens, padding_tensor), dim=2)
|
100 |
+
|
101 |
+
# adding indicator tokens, after which tokens' shape should become [BatchSize, 1+#Token+1, VocabSize]
|
102 |
+
begin_indicator = torch.zeros(size=(batch_size, 1),
|
103 |
+
dtype=torch.long,
|
104 |
+
device=tokens.device,
|
105 |
+
requires_grad=False) + self.config.vocab_size - 2
|
106 |
+
begin_indicator_token = torch.nn.functional.one_hot(begin_indicator,
|
107 |
+
num_classes=self.config.vocab_size).to(
|
108 |
+
dtype=tokens.dtype)
|
109 |
+
end_indicator = torch.zeros(size=(batch_size, 1),
|
110 |
+
dtype=torch.long,
|
111 |
+
device=tokens.device,
|
112 |
+
requires_grad=False) + self.config.vocab_size - 1
|
113 |
+
end_indicator_token = torch.nn.functional.one_hot(end_indicator,
|
114 |
+
num_classes=self.config.vocab_size).to(dtype=tokens.dtype)
|
115 |
+
tokens = torch.cat((begin_indicator_token, tokens, end_indicator_token), dim=1)
|
116 |
+
return tokens
|
117 |
+
|
118 |
+
|
119 |
+
AutoConfig.register(MODEL_TYPE, ClipVisualTokenizerConfig)
|
120 |
+
AutoModel.register(ClipVisualTokenizerConfig, ClipVisualTokenizer)
|
config.json
ADDED
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"Ovis"
|
4 |
+
],
|
5 |
+
"auto_map": {
|
6 |
+
"AutoConfig": "configuration_ovis.OvisConfig",
|
7 |
+
"AutoModelForCausalLM": "modeling_ovis.Ovis"
|
8 |
+
},
|
9 |
+
"conversation_formatter_class": "QwenConversationFormatter",
|
10 |
+
"hidden_size": 4096,
|
11 |
+
"llm_config": {
|
12 |
+
"_name_or_path": "Qwen/Qwen1.5-7B-Chat",
|
13 |
+
"add_cross_attention": false,
|
14 |
+
"architectures": [
|
15 |
+
"Qwen2ForCausalLM"
|
16 |
+
],
|
17 |
+
"attention_dropout": 0.0,
|
18 |
+
"bad_words_ids": null,
|
19 |
+
"begin_suppress_tokens": null,
|
20 |
+
"bos_token_id": 151643,
|
21 |
+
"chunk_size_feed_forward": 0,
|
22 |
+
"cross_attention_hidden_size": null,
|
23 |
+
"decoder_start_token_id": null,
|
24 |
+
"diversity_penalty": 0.0,
|
25 |
+
"do_sample": false,
|
26 |
+
"early_stopping": false,
|
27 |
+
"encoder_no_repeat_ngram_size": 0,
|
28 |
+
"eos_token_id": 151645,
|
29 |
+
"exponential_decay_length_penalty": null,
|
30 |
+
"finetuning_task": null,
|
31 |
+
"forced_bos_token_id": null,
|
32 |
+
"forced_eos_token_id": null,
|
33 |
+
"hidden_act": "silu",
|
34 |
+
"hidden_size": 4096,
|
35 |
+
"id2label": {
|
36 |
+
"0": "LABEL_0",
|
37 |
+
"1": "LABEL_1"
|
38 |
+
},
|
39 |
+
"initializer_range": 0.02,
|
40 |
+
"intermediate_size": 11008,
|
41 |
+
"is_decoder": false,
|
42 |
+
"is_encoder_decoder": false,
|
43 |
+
"label2id": {
|
44 |
+
"LABEL_0": 0,
|
45 |
+
"LABEL_1": 1
|
46 |
+
},
|
47 |
+
"length_penalty": 1.0,
|
48 |
+
"max_length": 20,
|
49 |
+
"max_position_embeddings": 32768,
|
50 |
+
"max_window_layers": 28,
|
51 |
+
"min_length": 0,
|
52 |
+
"model_type": "qwen2",
|
53 |
+
"no_repeat_ngram_size": 0,
|
54 |
+
"num_attention_heads": 32,
|
55 |
+
"num_beam_groups": 1,
|
56 |
+
"num_beams": 1,
|
57 |
+
"num_hidden_layers": 32,
|
58 |
+
"num_key_value_heads": 32,
|
59 |
+
"num_return_sequences": 1,
|
60 |
+
"output_attentions": false,
|
61 |
+
"output_hidden_states": false,
|
62 |
+
"output_scores": false,
|
63 |
+
"pad_token_id": null,
|
64 |
+
"prefix": null,
|
65 |
+
"problem_type": null,
|
66 |
+
"pruned_heads": {},
|
67 |
+
"remove_invalid_values": false,
|
68 |
+
"repetition_penalty": 1.0,
|
69 |
+
"return_dict": true,
|
70 |
+
"return_dict_in_generate": false,
|
71 |
+
"rms_norm_eps": 1e-06,
|
72 |
+
"rope_theta": 1000000.0,
|
73 |
+
"sep_token_id": null,
|
74 |
+
"sliding_window": 32768,
|
75 |
+
"suppress_tokens": null,
|
76 |
+
"task_specific_params": null,
|
77 |
+
"temperature": 1.0,
|
78 |
+
"tf_legacy_loss": false,
|
79 |
+
"tie_encoder_decoder": false,
|
80 |
+
"tie_word_embeddings": false,
|
81 |
+
"tokenizer_class": null,
|
82 |
+
"top_k": 50,
|
83 |
+
"top_p": 1.0,
|
84 |
+
"torch_dtype": "bfloat16",
|
85 |
+
"torchscript": false,
|
86 |
+
"typical_p": 1.0,
|
87 |
+
"use_bfloat16": false,
|
88 |
+
"use_cache": true,
|
89 |
+
"use_sliding_window": false,
|
90 |
+
"vocab_size": 151936
|
91 |
+
},
|
92 |
+
"model_type": "ovis",
|
93 |
+
"multimodal_max_length": 2048,
|
94 |
+
"torch_dtype": "bfloat16",
|
95 |
+
"transformers_version": "4.41.1",
|
96 |
+
"use_cache": true,
|
97 |
+
"visual_tokenizer_config": {
|
98 |
+
"_name_or_path": "",
|
99 |
+
"add_cross_attention": false,
|
100 |
+
"architectures": null,
|
101 |
+
"backbone_config": {
|
102 |
+
"_name_or_path": "openai/clip-vit-large-patch14-336",
|
103 |
+
"add_cross_attention": false,
|
104 |
+
"architectures": null,
|
105 |
+
"attention_dropout": 0.0,
|
106 |
+
"bad_words_ids": null,
|
107 |
+
"begin_suppress_tokens": null,
|
108 |
+
"bos_token_id": null,
|
109 |
+
"chunk_size_feed_forward": 0,
|
110 |
+
"cross_attention_hidden_size": null,
|
111 |
+
"decoder_start_token_id": null,
|
112 |
+
"diversity_penalty": 0.0,
|
113 |
+
"do_sample": false,
|
114 |
+
"dropout": 0.0,
|
115 |
+
"early_stopping": false,
|
116 |
+
"encoder_no_repeat_ngram_size": 0,
|
117 |
+
"eos_token_id": null,
|
118 |
+
"exponential_decay_length_penalty": null,
|
119 |
+
"finetuning_task": null,
|
120 |
+
"forced_bos_token_id": null,
|
121 |
+
"forced_eos_token_id": null,
|
122 |
+
"hidden_act": "quick_gelu",
|
123 |
+
"hidden_size": 1024,
|
124 |
+
"id2label": {
|
125 |
+
"0": "LABEL_0",
|
126 |
+
"1": "LABEL_1"
|
127 |
+
},
|
128 |
+
"image_size": 336,
|
129 |
+
"initializer_factor": 1.0,
|
130 |
+
"initializer_range": 0.02,
|
131 |
+
"intermediate_size": 4096,
|
132 |
+
"is_decoder": false,
|
133 |
+
"is_encoder_decoder": false,
|
134 |
+
"label2id": {
|
135 |
+
"LABEL_0": 0,
|
136 |
+
"LABEL_1": 1
|
137 |
+
},
|
138 |
+
"layer_norm_eps": 1e-05,
|
139 |
+
"length_penalty": 1.0,
|
140 |
+
"max_length": 20,
|
141 |
+
"min_length": 0,
|
142 |
+
"model_type": "clip_vision_model",
|
143 |
+
"no_repeat_ngram_size": 0,
|
144 |
+
"num_attention_heads": 16,
|
145 |
+
"num_beam_groups": 1,
|
146 |
+
"num_beams": 1,
|
147 |
+
"num_channels": 3,
|
148 |
+
"num_hidden_layers": 24,
|
149 |
+
"num_return_sequences": 1,
|
150 |
+
"output_attentions": false,
|
151 |
+
"output_hidden_states": false,
|
152 |
+
"output_scores": false,
|
153 |
+
"pad_token_id": null,
|
154 |
+
"patch_size": 14,
|
155 |
+
"prefix": null,
|
156 |
+
"problem_type": null,
|
157 |
+
"projection_dim": 768,
|
158 |
+
"pruned_heads": {},
|
159 |
+
"remove_invalid_values": false,
|
160 |
+
"repetition_penalty": 1.0,
|
161 |
+
"return_dict": true,
|
162 |
+
"return_dict_in_generate": false,
|
163 |
+
"sep_token_id": null,
|
164 |
+
"suppress_tokens": null,
|
165 |
+
"task_specific_params": null,
|
166 |
+
"temperature": 1.0,
|
167 |
+
"tf_legacy_loss": false,
|
168 |
+
"tie_encoder_decoder": false,
|
169 |
+
"tie_word_embeddings": true,
|
170 |
+
"tokenizer_class": null,
|
171 |
+
"top_k": 50,
|
172 |
+
"top_p": 1.0,
|
173 |
+
"torch_dtype": null,
|
174 |
+
"torchscript": false,
|
175 |
+
"typical_p": 1.0,
|
176 |
+
"use_bfloat16": false
|
177 |
+
},
|
178 |
+
"backbone_kwargs": {},
|
179 |
+
"bad_words_ids": null,
|
180 |
+
"begin_suppress_tokens": null,
|
181 |
+
"bos_token_id": null,
|
182 |
+
"chunk_size_feed_forward": 0,
|
183 |
+
"cross_attention_hidden_size": null,
|
184 |
+
"decoder_start_token_id": null,
|
185 |
+
"depths": null,
|
186 |
+
"diversity_penalty": 0.0,
|
187 |
+
"do_sample": false,
|
188 |
+
"drop_cls_token": true,
|
189 |
+
"early_stopping": false,
|
190 |
+
"encoder_no_repeat_ngram_size": 0,
|
191 |
+
"eos_token_id": null,
|
192 |
+
"exponential_decay_length_penalty": null,
|
193 |
+
"finetuning_task": null,
|
194 |
+
"forced_bos_token_id": null,
|
195 |
+
"forced_eos_token_id": null,
|
196 |
+
"hidden_stride": 1,
|
197 |
+
"id2label": {
|
198 |
+
"0": "LABEL_0",
|
199 |
+
"1": "LABEL_1"
|
200 |
+
},
|
201 |
+
"is_decoder": false,
|
202 |
+
"is_encoder_decoder": false,
|
203 |
+
"label2id": {
|
204 |
+
"LABEL_0": 0,
|
205 |
+
"LABEL_1": 1
|
206 |
+
},
|
207 |
+
"length_penalty": 1.0,
|
208 |
+
"max_length": 20,
|
209 |
+
"min_length": 0,
|
210 |
+
"model_type": "clip_visual_tokenizer",
|
211 |
+
"no_repeat_ngram_size": 0,
|
212 |
+
"num_beam_groups": 1,
|
213 |
+
"num_beams": 1,
|
214 |
+
"num_return_sequences": 1,
|
215 |
+
"output_attentions": false,
|
216 |
+
"output_hidden_states": false,
|
217 |
+
"output_scores": false,
|
218 |
+
"pad_token_id": null,
|
219 |
+
"prefix": null,
|
220 |
+
"problem_type": null,
|
221 |
+
"pruned_heads": {},
|
222 |
+
"remove_invalid_values": false,
|
223 |
+
"repetition_penalty": 1.0,
|
224 |
+
"return_dict": true,
|
225 |
+
"return_dict_in_generate": false,
|
226 |
+
"sep_token_id": null,
|
227 |
+
"suppress_tokens": null,
|
228 |
+
"task_specific_params": null,
|
229 |
+
"tau": 1.0,
|
230 |
+
"temperature": 1.0,
|
231 |
+
"tf_legacy_loss": false,
|
232 |
+
"tie_encoder_decoder": false,
|
233 |
+
"tie_word_embeddings": true,
|
234 |
+
"tokenize_function": "softmax",
|
235 |
+
"tokenizer_class": null,
|
236 |
+
"top_k": 50,
|
237 |
+
"top_p": 1.0,
|
238 |
+
"torch_dtype": null,
|
239 |
+
"torchscript": false,
|
240 |
+
"typical_p": 1.0,
|
241 |
+
"use_bfloat16": false,
|
242 |
+
"use_indicators": true,
|
243 |
+
"vocab_size": 131072
|
244 |
+
}
|
245 |
+
}
|
configuration_ovis.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Union, Optional
|
2 |
+
|
3 |
+
from transformers import PretrainedConfig, AutoConfig
|
4 |
+
from .visual_tokenizer import ClipVisualTokenizerConfig
|
5 |
+
|
6 |
+
class OvisConfig(PretrainedConfig):
|
7 |
+
model_type = "ovis"
|
8 |
+
|
9 |
+
def __init__(self,
|
10 |
+
llm_config: Optional[Union[PretrainedConfig, dict]] = None,
|
11 |
+
visual_tokenizer_config: Optional[Union[PretrainedConfig, dict]] = None,
|
12 |
+
multimodal_max_length=2048,
|
13 |
+
hidden_size=None,
|
14 |
+
conversation_formatter_class=None,
|
15 |
+
**kwargs):
|
16 |
+
super().__init__(**kwargs)
|
17 |
+
if llm_config is not None:
|
18 |
+
assert isinstance(llm_config, (PretrainedConfig, dict)), \
|
19 |
+
f"expect `llm_config` to be instance of PretrainedConfig or dict, but got {type(llm_config)} type"
|
20 |
+
if not isinstance(llm_config, PretrainedConfig):
|
21 |
+
model_type = llm_config['model_type']
|
22 |
+
llm_config.pop('model_type')
|
23 |
+
llm_config = AutoConfig.for_model(model_type, **llm_config)
|
24 |
+
self.llm_config = llm_config
|
25 |
+
if visual_tokenizer_config is not None:
|
26 |
+
assert isinstance(visual_tokenizer_config, (PretrainedConfig, dict)), \
|
27 |
+
f"expect `visual_tokenizer_config` to be instance of PretrainedConfig or dict, but got {type(visual_tokenizer_config)} type"
|
28 |
+
if not isinstance(visual_tokenizer_config, PretrainedConfig):
|
29 |
+
model_type = visual_tokenizer_config['model_type']
|
30 |
+
visual_tokenizer_config.pop('model_type')
|
31 |
+
visual_tokenizer_config = AutoConfig.for_model(model_type, **visual_tokenizer_config)
|
32 |
+
self.visual_tokenizer_config = visual_tokenizer_config
|
33 |
+
self.multimodal_max_length = multimodal_max_length
|
34 |
+
self.hidden_size = hidden_size
|
35 |
+
self.conversation_formatter_class = conversation_formatter_class
|
conversation_formatter.py
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from abc import ABC, abstractmethod
|
2 |
+
from typing import List, Dict
|
3 |
+
|
4 |
+
import torch
|
5 |
+
|
6 |
+
from .utils import IMAGE_TOKEN_INDEX, IGNORE_INDEX, IMAGE_TOKEN
|
7 |
+
|
8 |
+
|
9 |
+
class ConversationFormatter(ABC):
|
10 |
+
support_tokenizer_types = None
|
11 |
+
|
12 |
+
def __init__(self, tokenizer):
|
13 |
+
tokenizer_type = type(tokenizer).__name__
|
14 |
+
assert tokenizer_type in self.support_tokenizer_types, \
|
15 |
+
f'Invalid tokenizer type, expected one from `{self.support_tokenizer_types}`, but got `{tokenizer_type}`'
|
16 |
+
|
17 |
+
@abstractmethod
|
18 |
+
def format(self, conversations: List[Dict], generation_preface=None):
|
19 |
+
pass
|
20 |
+
|
21 |
+
@abstractmethod
|
22 |
+
def format_query(self, query, generation_preface=""):
|
23 |
+
pass
|
24 |
+
|
25 |
+
|
26 |
+
class QwenConversationFormatter(ConversationFormatter):
|
27 |
+
support_tokenizer_types = ['QWenTokenizer', 'Qwen2TokenizerFast']
|
28 |
+
|
29 |
+
def __init__(self, tokenizer):
|
30 |
+
super().__init__(tokenizer)
|
31 |
+
self.tokenizer = tokenizer
|
32 |
+
self.from2role = {
|
33 |
+
"system": "<|im_start|>system\n",
|
34 |
+
"human": "<|im_start|>user\n",
|
35 |
+
"gpt": "<|im_start|>assistant\n",
|
36 |
+
}
|
37 |
+
self.gpt_token_num = None
|
38 |
+
self.im_end = "<|im_end|>"
|
39 |
+
self.image_symbol = IMAGE_TOKEN
|
40 |
+
self.image_token_index = IMAGE_TOKEN_INDEX
|
41 |
+
self.ignore_index = IGNORE_INDEX
|
42 |
+
self.default_system_prompt = "You are a helpful assistant."
|
43 |
+
|
44 |
+
def _tokenize_with_image_symbol(self, text):
|
45 |
+
text_chunks = [self.tokenizer(chunk, add_special_tokens=False).input_ids for chunk in
|
46 |
+
text.split(self.image_symbol)]
|
47 |
+
token_ids = []
|
48 |
+
num_chuck = len(text_chunks)
|
49 |
+
for i, chunk in enumerate(text_chunks):
|
50 |
+
token_ids.extend(chunk)
|
51 |
+
if i < num_chuck - 1:
|
52 |
+
token_ids.append(self.image_token_index)
|
53 |
+
return token_ids
|
54 |
+
|
55 |
+
def format(self, conversations: List[Dict], generation_preface=None):
|
56 |
+
if self.gpt_token_num is None:
|
57 |
+
self.gpt_token_num = len(self.tokenizer(self.from2role["gpt"], add_special_tokens=False).input_ids)
|
58 |
+
|
59 |
+
if conversations[0]["from"] != "system":
|
60 |
+
conversations.insert(0, {
|
61 |
+
"from": "system",
|
62 |
+
"value": self.default_system_prompt
|
63 |
+
})
|
64 |
+
|
65 |
+
if generation_preface is not None:
|
66 |
+
conversations.append({
|
67 |
+
"from": "gpt",
|
68 |
+
"value": generation_preface
|
69 |
+
})
|
70 |
+
|
71 |
+
prompt = ""
|
72 |
+
input_ids = []
|
73 |
+
labels = []
|
74 |
+
num_conversation = len(conversations)
|
75 |
+
for i, conversation in enumerate(conversations):
|
76 |
+
frm = conversation["from"]
|
77 |
+
role = self.from2role[frm]
|
78 |
+
message = conversation["value"]
|
79 |
+
text = role + message
|
80 |
+
if i < num_conversation - 1 or generation_preface is None:
|
81 |
+
text += self.im_end
|
82 |
+
if i < num_conversation - 1:
|
83 |
+
text += '\n'
|
84 |
+
prompt += text
|
85 |
+
token_ids = self._tokenize_with_image_symbol(text)
|
86 |
+
input_ids.extend(token_ids)
|
87 |
+
label_ids = [self.ignore_index] * len(token_ids)
|
88 |
+
if frm == "gpt":
|
89 |
+
label_ids[self.gpt_token_num:] = token_ids[self.gpt_token_num:]
|
90 |
+
labels.extend(label_ids)
|
91 |
+
|
92 |
+
assert self._tokenize_with_image_symbol(prompt) == input_ids
|
93 |
+
assert len(input_ids) == len(labels)
|
94 |
+
input_ids = torch.tensor(input_ids, dtype=torch.long)
|
95 |
+
labels = torch.tensor(labels, dtype=torch.long)
|
96 |
+
|
97 |
+
return prompt, input_ids, labels
|
98 |
+
|
99 |
+
def format_query(self, query, generation_preface=""):
|
100 |
+
prompt, input_ids, _ = self.format([{
|
101 |
+
"from": "human",
|
102 |
+
"value": query
|
103 |
+
}], generation_preface=generation_preface)
|
104 |
+
|
105 |
+
return prompt, input_ids
|
106 |
+
|
107 |
+
|
108 |
+
class Llama3ConversationFormatter(ConversationFormatter):
|
109 |
+
support_tokenizer_types = ['PreTrainedTokenizerFast']
|
110 |
+
|
111 |
+
def __init__(self, tokenizer):
|
112 |
+
super().__init__(tokenizer)
|
113 |
+
self.tokenizer = tokenizer
|
114 |
+
self.from2role = {
|
115 |
+
"system": "<|start_header_id|>system<|end_header_id|>\n\n",
|
116 |
+
"human": "<|start_header_id|>user<|end_header_id|>\n\n",
|
117 |
+
"gpt": "<|start_header_id|>assistant<|end_header_id|>\n\n",
|
118 |
+
}
|
119 |
+
self.gpt_token_num = None
|
120 |
+
self.im_end = "<|eot_id|>"
|
121 |
+
self.image_symbol = IMAGE_TOKEN
|
122 |
+
self.image_token_index = IMAGE_TOKEN_INDEX
|
123 |
+
self.ignore_index = IGNORE_INDEX
|
124 |
+
self.default_system_prompt = "You are a helpful and honest multimodal assistant."
|
125 |
+
self.bos_token = "<|begin_of_text|>"
|
126 |
+
self.bos_token_ids = None
|
127 |
+
|
128 |
+
def _tokenize_with_image_symbol(self, text):
|
129 |
+
text_chunks = [self.tokenizer(chunk, add_special_tokens=False).input_ids for chunk in
|
130 |
+
text.split(self.image_symbol)]
|
131 |
+
token_ids = []
|
132 |
+
num_chuck = len(text_chunks)
|
133 |
+
for i, chunk in enumerate(text_chunks):
|
134 |
+
token_ids.extend(chunk)
|
135 |
+
if i < num_chuck - 1:
|
136 |
+
token_ids.append(self.image_token_index)
|
137 |
+
return token_ids
|
138 |
+
|
139 |
+
def format(self, conversations: List[Dict], generation_preface=None):
|
140 |
+
if self.gpt_token_num is None:
|
141 |
+
self.gpt_token_num = len(self.tokenizer(self.from2role["gpt"], add_special_tokens=False).input_ids)
|
142 |
+
|
143 |
+
if self.bos_token_ids is None:
|
144 |
+
self.bos_token_ids = self.tokenizer(self.bos_token, add_special_tokens=False).input_ids
|
145 |
+
|
146 |
+
if conversations[0]["from"] != "system":
|
147 |
+
conversations.insert(0, {
|
148 |
+
"from": "system",
|
149 |
+
"value": self.default_system_prompt
|
150 |
+
})
|
151 |
+
|
152 |
+
if generation_preface is not None:
|
153 |
+
conversations.append({
|
154 |
+
"from": "gpt",
|
155 |
+
"value": generation_preface
|
156 |
+
})
|
157 |
+
|
158 |
+
prompt = "" + self.bos_token
|
159 |
+
input_ids = [] + self.bos_token_ids
|
160 |
+
labels = [] + [IGNORE_INDEX] * len(input_ids)
|
161 |
+
num_conversation = len(conversations)
|
162 |
+
for i, conversation in enumerate(conversations):
|
163 |
+
frm = conversation["from"]
|
164 |
+
role = self.from2role[frm]
|
165 |
+
message = conversation["value"].strip()
|
166 |
+
text = role + message
|
167 |
+
if i < num_conversation - 1 or generation_preface is None:
|
168 |
+
text += self.im_end
|
169 |
+
prompt += text
|
170 |
+
token_ids = self._tokenize_with_image_symbol(text)
|
171 |
+
input_ids.extend(token_ids)
|
172 |
+
label_ids = [self.ignore_index] * len(token_ids)
|
173 |
+
if frm == "gpt":
|
174 |
+
label_ids[self.gpt_token_num:] = token_ids[self.gpt_token_num:]
|
175 |
+
labels.extend(label_ids)
|
176 |
+
|
177 |
+
assert self._tokenize_with_image_symbol(prompt) == input_ids
|
178 |
+
assert len(input_ids) == len(labels)
|
179 |
+
input_ids = torch.tensor(input_ids, dtype=torch.long)
|
180 |
+
labels = torch.tensor(labels, dtype=torch.long)
|
181 |
+
|
182 |
+
return prompt, input_ids, labels
|
183 |
+
|
184 |
+
def format_query(self, query, generation_preface=""):
|
185 |
+
prompt, input_ids, _ = self.format([{
|
186 |
+
"from": "human",
|
187 |
+
"value": query
|
188 |
+
}], generation_preface=generation_preface)
|
189 |
+
|
190 |
+
return prompt, input_ids
|
generation_config.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token_id": 151643,
|
3 |
+
"do_sample": true,
|
4 |
+
"eos_token_id": [
|
5 |
+
151645,
|
6 |
+
151643
|
7 |
+
],
|
8 |
+
"multimodal_max_length": 2048,
|
9 |
+
"pad_token_id": 151643,
|
10 |
+
"repetition_penalty": 1.05,
|
11 |
+
"temperature": 0.7,
|
12 |
+
"top_k": 20,
|
13 |
+
"top_p": 0.8,
|
14 |
+
"transformers_version": "4.41.1"
|
15 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
modeling_ovis.py
ADDED
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from datetime import datetime
|
3 |
+
from importlib import import_module
|
4 |
+
from typing import List, Union, Callable, Optional
|
5 |
+
|
6 |
+
import deepspeed
|
7 |
+
import torch
|
8 |
+
from torch import Tensor, LongTensor, IntTensor
|
9 |
+
from torch.nn import init
|
10 |
+
from transformers import PreTrainedModel, AutoConfig, AutoModel, AutoTokenizer, AutoModelForCausalLM
|
11 |
+
from transformers.integrations.deepspeed import is_deepspeed_zero3_enabled, deepspeed_config
|
12 |
+
|
13 |
+
from .visual_tokenizer import ClipVisualTokenizer
|
14 |
+
from .configuration_ovis import OvisConfig
|
15 |
+
from .conversation_formatter import ConversationFormatter
|
16 |
+
from .utils import IGNORE_INDEX, IMAGE_TOKEN_INDEX, BEGIN_LINE, END_LINE, rank0_print
|
17 |
+
|
18 |
+
class VisualEmbedding(torch.nn.Embedding):
|
19 |
+
def forward(self, input: Tensor) -> Tensor:
|
20 |
+
if any((isinstance(input, LongTensor), isinstance(input, IntTensor))):
|
21 |
+
return super().forward(input)
|
22 |
+
return torch.matmul(input, self.weight)
|
23 |
+
|
24 |
+
def reset_parameters(self, mean=0., std=1.) -> None:
|
25 |
+
init.normal_(self.weight, mean=mean, std=std)
|
26 |
+
self._fill_padding_idx_with_zero()
|
27 |
+
|
28 |
+
|
29 |
+
class OvisPreTrainedModel(PreTrainedModel):
|
30 |
+
config_class = OvisConfig
|
31 |
+
base_model_prefix = "ovis"
|
32 |
+
|
33 |
+
|
34 |
+
class Ovis(OvisPreTrainedModel):
|
35 |
+
|
36 |
+
def __init__(self, config: OvisConfig, *inputs, **kwargs):
|
37 |
+
super().__init__(config, *inputs, **kwargs)
|
38 |
+
if kwargs.get('train_from_scratch'):
|
39 |
+
self.llm = AutoModelForCausalLM.from_pretrained(kwargs['llm_name_or_path'], token=None) # add token for gated model
|
40 |
+
self.generation_config = self.llm.generation_config
|
41 |
+
self.config.llm_config = self.llm.config
|
42 |
+
self.config.hidden_size = self.llm.config.hidden_size # for deepspeed auto configuration
|
43 |
+
self.text_tokenizer = AutoTokenizer.from_pretrained(kwargs['llm_name_or_path'], token=None) # add token for gated model
|
44 |
+
if self.text_tokenizer.pad_token_id is None and kwargs.get('pad_token_id') is not None:
|
45 |
+
self.text_tokenizer.pad_token_id = kwargs['pad_token_id']
|
46 |
+
if kwargs.get('visual_tokenizer_pretrained_path'):
|
47 |
+
self.visual_tokenizer = AutoModel.from_pretrained(kwargs['visual_tokenizer_pretrained_path'],
|
48 |
+
image_processor_name_or_path=kwargs[
|
49 |
+
'visual_tokenizer_pretrained_path'])
|
50 |
+
else:
|
51 |
+
self.visual_tokenizer = AutoModel.from_config(self.config.visual_tokenizer_config,
|
52 |
+
train_from_scratch=True)
|
53 |
+
self.config.visual_tokenizer_config = self.visual_tokenizer.config
|
54 |
+
else:
|
55 |
+
self.llm = AutoModelForCausalLM.from_config(self.config.llm_config)
|
56 |
+
assert self.config.hidden_size == self.llm.config.hidden_size, "hidden size mismatch"
|
57 |
+
self.text_tokenizer = AutoTokenizer.from_pretrained(self.config.name_or_path)
|
58 |
+
self.visual_tokenizer = AutoModel.from_config(self.config.visual_tokenizer_config,
|
59 |
+
image_processor_name_or_path=self.config.name_or_path)
|
60 |
+
|
61 |
+
# initialize vte
|
62 |
+
if is_deepspeed_zero3_enabled():
|
63 |
+
with deepspeed.zero.Init(config_dict_or_path=deepspeed_config()):
|
64 |
+
self.vte = VisualEmbedding(self.config.visual_tokenizer_config.vocab_size, self.config.hidden_size)
|
65 |
+
else:
|
66 |
+
self.visual_tokenizer.to(device=self.llm.device)
|
67 |
+
self.vte = VisualEmbedding(self.config.visual_tokenizer_config.vocab_size, self.config.hidden_size,
|
68 |
+
device=self.visual_tokenizer.device, dtype=self.visual_tokenizer.dtype)
|
69 |
+
|
70 |
+
def _merge_modules(modules_list: tuple):
|
71 |
+
merged_modules = []
|
72 |
+
for modules in modules_list:
|
73 |
+
merged_modules.extend(modules if modules else [])
|
74 |
+
return merged_modules
|
75 |
+
|
76 |
+
self._no_split_modules = _merge_modules((self.llm._no_split_modules, self.visual_tokenizer._no_split_modules))
|
77 |
+
self._skip_keys_device_placement = self.llm._skip_keys_device_placement
|
78 |
+
self._keep_in_fp32_modules = _merge_modules(
|
79 |
+
(self.llm._keep_in_fp32_modules, self.visual_tokenizer._keep_in_fp32_modules))
|
80 |
+
self.is_parallelizable = all((self.llm.is_parallelizable, self.visual_tokenizer.is_parallelizable))
|
81 |
+
self.supports_gradient_checkpointing = all(
|
82 |
+
(self.llm.supports_gradient_checkpointing, self.visual_tokenizer.supports_gradient_checkpointing))
|
83 |
+
self._supports_flash_attn_2 = all(
|
84 |
+
(self.llm._supports_flash_attn_2, self.visual_tokenizer._supports_flash_attn_2))
|
85 |
+
self._supports_sdpa = all((self.llm._supports_sdpa, self.visual_tokenizer._supports_sdpa))
|
86 |
+
self._supports_cache_class = all((self.llm._supports_cache_class, self.visual_tokenizer._supports_cache_class))
|
87 |
+
|
88 |
+
def get_text_tokenizer(self):
|
89 |
+
return self.text_tokenizer
|
90 |
+
|
91 |
+
def get_visual_tokenizer(self):
|
92 |
+
return self.visual_tokenizer
|
93 |
+
|
94 |
+
def re_init_vte(self, mean, std):
|
95 |
+
vte = self.get_vte()
|
96 |
+
rank0_print(BEGIN_LINE)
|
97 |
+
rank0_print(f'[{datetime.now()}] Before re-initialization of vte: ')
|
98 |
+
with deepspeed.zero.GatheredParameters([vte.weight]):
|
99 |
+
rank0_print(f'vte.weight: {vte.weight}')
|
100 |
+
with deepspeed.zero.GatheredParameters([vte.weight], modifier_rank=0):
|
101 |
+
if not is_deepspeed_zero3_enabled() or deepspeed.comm.get_rank() == 0:
|
102 |
+
vte.reset_parameters(mean, std)
|
103 |
+
rank0_print(f'[{datetime.now()}] After re-initialization of vte:')
|
104 |
+
with deepspeed.zero.GatheredParameters([vte.weight]):
|
105 |
+
rank0_print(f'vte.weight: {vte.weight}')
|
106 |
+
rank0_print(END_LINE)
|
107 |
+
|
108 |
+
def get_monitor_tensors(self):
|
109 |
+
monitor_tensors = dict(
|
110 |
+
wte=self.get_wte().weight,
|
111 |
+
lm_head=self.get_lm_head().weight,
|
112 |
+
vte=self.get_vte().weight
|
113 |
+
)
|
114 |
+
monitor_tensors.update(
|
115 |
+
{f'visual_tokenizer_{k}': v for k, v in self.get_visual_tokenizer().get_monitor_tensors().items()})
|
116 |
+
return monitor_tensors
|
117 |
+
|
118 |
+
def get_lm_head(self):
|
119 |
+
return self.get_llm().get_output_embeddings()
|
120 |
+
|
121 |
+
def get_llm(self):
|
122 |
+
return self.llm
|
123 |
+
|
124 |
+
def get_vte(self):
|
125 |
+
return self.vte
|
126 |
+
|
127 |
+
def get_wte(self):
|
128 |
+
return self.llm.get_input_embeddings()
|
129 |
+
|
130 |
+
def get_conversation_formatter(self) -> ConversationFormatter:
|
131 |
+
if getattr(self, 'conversation_formatter', None) is None:
|
132 |
+
self.conversation_formatter = getattr(import_module(".conversation_formatter", __package__),
|
133 |
+
self.config.conversation_formatter_class)(self.text_tokenizer)
|
134 |
+
return self.conversation_formatter
|
135 |
+
|
136 |
+
def forward(self, input_ids: torch.Tensor, attention_mask: torch.Tensor, pixel_values: List[Optional[torch.Tensor]],
|
137 |
+
labels: Optional[torch.Tensor] = None, **kwargs):
|
138 |
+
_, inputs_embeds, labels, attention_mask = self.merge_multimodal(
|
139 |
+
text_input_ids=input_ids,
|
140 |
+
text_attention_masks=attention_mask,
|
141 |
+
text_labels=labels,
|
142 |
+
pixel_values=pixel_values,
|
143 |
+
with_kv_cache=kwargs.get('past_key_values') is not None)
|
144 |
+
return self.llm(inputs_embeds=inputs_embeds, labels=labels, attention_mask=attention_mask, **kwargs)
|
145 |
+
|
146 |
+
def merge_multimodal(self, text_input_ids: torch.Tensor, text_attention_masks: torch.Tensor,
|
147 |
+
text_labels: Optional[torch.Tensor], pixel_values: List[Optional[torch.Tensor]],
|
148 |
+
with_kv_cache: bool = False):
|
149 |
+
if with_kv_cache:
|
150 |
+
return None, self.get_wte()(text_input_ids), text_labels, text_attention_masks
|
151 |
+
if self.training:
|
152 |
+
# When training, to be compatible with deepspeed zero, each sample has to include pixel_value tensor.
|
153 |
+
# For text-only sample, one can simply use a full zero tensor as pixel_value, which will be ignored
|
154 |
+
# (see below in this function); so, the gradient will not be affected.
|
155 |
+
num_images = [x.shape[0] for x in pixel_values]
|
156 |
+
visual_tokens = self.visual_tokenizer(torch.cat([x for x in pixel_values], dim=0))
|
157 |
+
visual_embeds = torch.split(self.get_vte()(visual_tokens).to(dtype=self.dtype),
|
158 |
+
split_size_or_sections=num_images, dim=0)
|
159 |
+
visual_input_ids = torch.split(torch.argmax(visual_tokens, dim=-1),
|
160 |
+
split_size_or_sections=num_images, dim=0)
|
161 |
+
visual_labels = [torch.full(x.shape, IGNORE_INDEX, dtype=torch.long) for x in visual_input_ids]
|
162 |
+
else:
|
163 |
+
# When inference, sample can include only text with `None` pixel_value
|
164 |
+
num_images = [x.shape[0] if x is not None else 0 for x in pixel_values]
|
165 |
+
if sum(num_images) > 0:
|
166 |
+
visual_tokens = self.visual_tokenizer(torch.cat([x for x in pixel_values if x is not None], dim=0))
|
167 |
+
visual_embeds = torch.split(self.get_vte()(visual_tokens).to(dtype=self.dtype),
|
168 |
+
split_size_or_sections=num_images, dim=0)
|
169 |
+
visual_input_ids = torch.split(torch.argmax(visual_tokens, dim=-1),
|
170 |
+
split_size_or_sections=num_images, dim=0)
|
171 |
+
visual_labels = [torch.full(x.shape, IGNORE_INDEX, dtype=torch.long) for x in visual_input_ids]
|
172 |
+
else:
|
173 |
+
# just placeholders
|
174 |
+
visual_embeds = [None] * len(num_images)
|
175 |
+
visual_input_ids = [None] * len(num_images)
|
176 |
+
visual_labels = [None] * len(num_images)
|
177 |
+
# just placeholders
|
178 |
+
text_labels = torch.full(text_input_ids.shape, IGNORE_INDEX, dtype=torch.long, device=text_input_ids.device)
|
179 |
+
|
180 |
+
input_embeds = []
|
181 |
+
attention_masks = []
|
182 |
+
labels = []
|
183 |
+
for text_input_id, text_label, text_attention_mask, visual_embed, visual_input_id, visual_label in zip(
|
184 |
+
text_input_ids, text_labels, text_attention_masks, visual_embeds, visual_input_ids, visual_labels
|
185 |
+
):
|
186 |
+
image_token_mask = torch.eq(text_input_id, IMAGE_TOKEN_INDEX)
|
187 |
+
text_embed = self.get_wte()(torch.masked_fill(text_input_id, image_token_mask, 0))
|
188 |
+
image_token_positions = torch.where(image_token_mask)[0].tolist()
|
189 |
+
if len(image_token_positions) > 0:
|
190 |
+
input_embed_parts = []
|
191 |
+
attention_mask_parts = []
|
192 |
+
label_parts = []
|
193 |
+
prev_image_token_position = -1
|
194 |
+
for index, image_token_position in enumerate(image_token_positions):
|
195 |
+
input_embed_parts.append(
|
196 |
+
text_embed[prev_image_token_position + 1:image_token_position, :])
|
197 |
+
label_parts.append(
|
198 |
+
text_label[prev_image_token_position + 1:image_token_position])
|
199 |
+
attention_mask_parts.append(
|
200 |
+
text_attention_mask[prev_image_token_position + 1:image_token_position])
|
201 |
+
input_embed_parts.append(visual_embed[index])
|
202 |
+
attention_mask_parts.append(
|
203 |
+
torch.ones_like(visual_label[index], device=text_label.device, dtype=torch.bool))
|
204 |
+
label_parts.append(visual_label[index].to(device=text_label.device))
|
205 |
+
prev_image_token_position = image_token_position
|
206 |
+
if prev_image_token_position + 1 < text_input_id.shape[0]:
|
207 |
+
input_embed_parts.append(
|
208 |
+
text_embed[prev_image_token_position + 1:, :])
|
209 |
+
attention_mask_parts.append(
|
210 |
+
text_attention_mask[prev_image_token_position + 1:])
|
211 |
+
label_parts.append(
|
212 |
+
text_label[prev_image_token_position + 1:])
|
213 |
+
input_embed = torch.cat(input_embed_parts, dim=0)
|
214 |
+
attention_mask = torch.cat(attention_mask_parts, dim=0)
|
215 |
+
label = torch.cat(label_parts, dim=0)
|
216 |
+
else:
|
217 |
+
input_embed = text_embed
|
218 |
+
attention_mask = text_attention_mask
|
219 |
+
label = text_label
|
220 |
+
if self.training:
|
221 |
+
# Make visual_embed involved in the backward graph, to be compatible with deepspeed zero and ddp.
|
222 |
+
input_embed += torch.sum(visual_embed * 0.0)
|
223 |
+
input_embeds.append(input_embed)
|
224 |
+
attention_masks.append(attention_mask)
|
225 |
+
labels.append(label)
|
226 |
+
|
227 |
+
batch_input_embeds = torch.nn.utils.rnn.pad_sequence(input_embeds, batch_first=True, padding_value=0.0)[:,
|
228 |
+
:self.config.multimodal_max_length, :]
|
229 |
+
batch_attention_mask = torch.nn.utils.rnn.pad_sequence(attention_masks, batch_first=True, padding_value=False)[
|
230 |
+
:,
|
231 |
+
:self.config.multimodal_max_length]
|
232 |
+
batch_labels = torch.nn.utils.rnn.pad_sequence(labels, batch_first=True, padding_value=IGNORE_INDEX)[:,
|
233 |
+
:self.config.multimodal_max_length]
|
234 |
+
|
235 |
+
return visual_input_ids, batch_input_embeds, batch_labels, batch_attention_mask
|
236 |
+
|
237 |
+
def save_pretrained(
|
238 |
+
self,
|
239 |
+
save_directory: Union[str, os.PathLike],
|
240 |
+
is_main_process: bool = True,
|
241 |
+
state_dict: Optional[dict] = None,
|
242 |
+
save_function: Callable = torch.save,
|
243 |
+
push_to_hub: bool = False,
|
244 |
+
max_shard_size: Union[int, str] = "5GB",
|
245 |
+
safe_serialization: bool = True,
|
246 |
+
variant: Optional[str] = None,
|
247 |
+
token: Optional[Union[str, bool]] = None,
|
248 |
+
save_peft_format: bool = True,
|
249 |
+
**kwargs,
|
250 |
+
):
|
251 |
+
super().save_pretrained(save_directory,
|
252 |
+
is_main_process=is_main_process,
|
253 |
+
state_dict=state_dict,
|
254 |
+
save_function=save_function,
|
255 |
+
safe_serialization=safe_serialization)
|
256 |
+
self.get_text_tokenizer().save_pretrained(save_directory)
|
257 |
+
self.get_visual_tokenizer().get_image_processor().save_pretrained(save_directory)
|
258 |
+
|
259 |
+
# uncomment the following will additionally save a separate visual tokenizer
|
260 |
+
# visual_tokenizer_directory = os.path.join(save_directory, 'visual_tokenizer')
|
261 |
+
# self.get_visual_tokenizer().save_pretrained(visual_tokenizer_directory,
|
262 |
+
# is_main_process=is_main_process,
|
263 |
+
# state_dict=None,
|
264 |
+
# save_function=save_function,
|
265 |
+
# safe_serialization=safe_serialization)
|
266 |
+
# self.get_visual_tokenizer().get_image_processor().save_pretrained(visual_tokenizer_directory)
|
267 |
+
|
268 |
+
# TODO: support batch generation
|
269 |
+
def prepare_inputs_for_generation(
|
270 |
+
self, input_ids, pixel_values, attention_mask, past_key_values=None, inputs_embeds=None, **kwargs):
|
271 |
+
if past_key_values is not None:
|
272 |
+
input_ids = input_ids[:, -1:]
|
273 |
+
attention_mask = attention_mask[:, -1:]
|
274 |
+
|
275 |
+
# if `inputs_embeds` are passed, we only want to use them in the 1st generation step
|
276 |
+
if inputs_embeds is not None and past_key_values is None:
|
277 |
+
model_inputs = {"inputs_embeds": inputs_embeds}
|
278 |
+
else:
|
279 |
+
model_inputs = {"input_ids": input_ids}
|
280 |
+
|
281 |
+
model_inputs.update(
|
282 |
+
{
|
283 |
+
"past_key_values": past_key_values,
|
284 |
+
"use_cache": kwargs.get("use_cache"),
|
285 |
+
"attention_mask": attention_mask,
|
286 |
+
"pixel_values": pixel_values
|
287 |
+
}
|
288 |
+
)
|
289 |
+
return model_inputs
|
preprocessor_config.json
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_valid_processor_keys": [
|
3 |
+
"images",
|
4 |
+
"do_resize",
|
5 |
+
"size",
|
6 |
+
"resample",
|
7 |
+
"do_center_crop",
|
8 |
+
"crop_size",
|
9 |
+
"do_rescale",
|
10 |
+
"rescale_factor",
|
11 |
+
"do_normalize",
|
12 |
+
"image_mean",
|
13 |
+
"image_std",
|
14 |
+
"do_convert_rgb",
|
15 |
+
"return_tensors",
|
16 |
+
"data_format",
|
17 |
+
"input_data_format"
|
18 |
+
],
|
19 |
+
"crop_size": {
|
20 |
+
"height": 336,
|
21 |
+
"width": 336
|
22 |
+
},
|
23 |
+
"do_center_crop": false,
|
24 |
+
"do_convert_rgb": true,
|
25 |
+
"do_normalize": true,
|
26 |
+
"do_rescale": true,
|
27 |
+
"do_resize": true,
|
28 |
+
"image_mean": [
|
29 |
+
0.48145466,
|
30 |
+
0.4578275,
|
31 |
+
0.40821073
|
32 |
+
],
|
33 |
+
"image_processor_type": "CLIPImageProcessor",
|
34 |
+
"image_std": [
|
35 |
+
0.26862954,
|
36 |
+
0.26130258,
|
37 |
+
0.27577711
|
38 |
+
],
|
39 |
+
"resample": 3,
|
40 |
+
"rescale_factor": 0.00392156862745098,
|
41 |
+
"size": {
|
42 |
+
"shortest_edge": 336
|
43 |
+
}
|
44 |
+
}
|
pytorch_model-00001-of-00004.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e687fcc19ec389ccd887de95af76503ec6036fc127d7dec62d5bd60fad1978d6
|
3 |
+
size 4988508819
|
pytorch_model-00002-of-00004.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d5d35d3a58e406e898bc019a5bc9dd128c24021a66278d424ab5e63c5e025143
|
3 |
+
size 4981277820
|
pytorch_model-00003-of-00004.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b6b23ff0b5ab2b06379f6f648164c88dc5d89df30427f81d779314d594095564
|
3 |
+
size 4228335437
|
pytorch_model-00004-of-00004.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0082ecc301ec996fe1bd40d546964cc17394213fd790d216743eb8bc76caae26
|
3 |
+
size 3194519786
|
pytorch_model.bin.index.json
ADDED
@@ -0,0 +1,789 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"metadata": {
|
3 |
+
"total_size": 17392361464
|
4 |
+
},
|
5 |
+
"weight_map": {
|
6 |
+
"llm.lm_head.weight": "pytorch_model-00004-of-00004.bin",
|
7 |
+
"llm.model.embed_tokens.weight": "pytorch_model-00001-of-00004.bin",
|
8 |
+
"llm.model.layers.0.input_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
9 |
+
"llm.model.layers.0.mlp.down_proj.weight": "pytorch_model-00001-of-00004.bin",
|
10 |
+
"llm.model.layers.0.mlp.gate_proj.weight": "pytorch_model-00001-of-00004.bin",
|
11 |
+
"llm.model.layers.0.mlp.up_proj.weight": "pytorch_model-00001-of-00004.bin",
|
12 |
+
"llm.model.layers.0.post_attention_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
13 |
+
"llm.model.layers.0.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
14 |
+
"llm.model.layers.0.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
15 |
+
"llm.model.layers.0.self_attn.o_proj.weight": "pytorch_model-00001-of-00004.bin",
|
16 |
+
"llm.model.layers.0.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
17 |
+
"llm.model.layers.0.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
18 |
+
"llm.model.layers.0.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
19 |
+
"llm.model.layers.0.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
20 |
+
"llm.model.layers.1.input_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
21 |
+
"llm.model.layers.1.mlp.down_proj.weight": "pytorch_model-00001-of-00004.bin",
|
22 |
+
"llm.model.layers.1.mlp.gate_proj.weight": "pytorch_model-00001-of-00004.bin",
|
23 |
+
"llm.model.layers.1.mlp.up_proj.weight": "pytorch_model-00001-of-00004.bin",
|
24 |
+
"llm.model.layers.1.post_attention_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
25 |
+
"llm.model.layers.1.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
26 |
+
"llm.model.layers.1.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
27 |
+
"llm.model.layers.1.self_attn.o_proj.weight": "pytorch_model-00001-of-00004.bin",
|
28 |
+
"llm.model.layers.1.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
29 |
+
"llm.model.layers.1.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
30 |
+
"llm.model.layers.1.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
31 |
+
"llm.model.layers.1.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
32 |
+
"llm.model.layers.10.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
33 |
+
"llm.model.layers.10.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
34 |
+
"llm.model.layers.10.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
35 |
+
"llm.model.layers.10.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
36 |
+
"llm.model.layers.10.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
37 |
+
"llm.model.layers.10.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
38 |
+
"llm.model.layers.10.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
39 |
+
"llm.model.layers.10.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
40 |
+
"llm.model.layers.10.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
41 |
+
"llm.model.layers.10.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
42 |
+
"llm.model.layers.10.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
43 |
+
"llm.model.layers.10.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
44 |
+
"llm.model.layers.11.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
45 |
+
"llm.model.layers.11.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
46 |
+
"llm.model.layers.11.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
47 |
+
"llm.model.layers.11.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
48 |
+
"llm.model.layers.11.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
49 |
+
"llm.model.layers.11.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
50 |
+
"llm.model.layers.11.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
51 |
+
"llm.model.layers.11.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
52 |
+
"llm.model.layers.11.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
53 |
+
"llm.model.layers.11.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
54 |
+
"llm.model.layers.11.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
55 |
+
"llm.model.layers.11.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
56 |
+
"llm.model.layers.12.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
57 |
+
"llm.model.layers.12.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
58 |
+
"llm.model.layers.12.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
59 |
+
"llm.model.layers.12.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
60 |
+
"llm.model.layers.12.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
61 |
+
"llm.model.layers.12.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
62 |
+
"llm.model.layers.12.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
63 |
+
"llm.model.layers.12.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
64 |
+
"llm.model.layers.12.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
65 |
+
"llm.model.layers.12.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
66 |
+
"llm.model.layers.12.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
67 |
+
"llm.model.layers.12.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
68 |
+
"llm.model.layers.13.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
69 |
+
"llm.model.layers.13.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
70 |
+
"llm.model.layers.13.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
71 |
+
"llm.model.layers.13.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
72 |
+
"llm.model.layers.13.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
73 |
+
"llm.model.layers.13.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
74 |
+
"llm.model.layers.13.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
75 |
+
"llm.model.layers.13.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
76 |
+
"llm.model.layers.13.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
77 |
+
"llm.model.layers.13.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
78 |
+
"llm.model.layers.13.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
79 |
+
"llm.model.layers.13.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
80 |
+
"llm.model.layers.14.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
81 |
+
"llm.model.layers.14.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
82 |
+
"llm.model.layers.14.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
83 |
+
"llm.model.layers.14.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
84 |
+
"llm.model.layers.14.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
85 |
+
"llm.model.layers.14.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
86 |
+
"llm.model.layers.14.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
87 |
+
"llm.model.layers.14.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
88 |
+
"llm.model.layers.14.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
89 |
+
"llm.model.layers.14.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
90 |
+
"llm.model.layers.14.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
91 |
+
"llm.model.layers.14.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
92 |
+
"llm.model.layers.15.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
93 |
+
"llm.model.layers.15.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
94 |
+
"llm.model.layers.15.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
95 |
+
"llm.model.layers.15.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
96 |
+
"llm.model.layers.15.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
97 |
+
"llm.model.layers.15.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
98 |
+
"llm.model.layers.15.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
99 |
+
"llm.model.layers.15.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
100 |
+
"llm.model.layers.15.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
101 |
+
"llm.model.layers.15.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
102 |
+
"llm.model.layers.15.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
103 |
+
"llm.model.layers.15.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
104 |
+
"llm.model.layers.16.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
105 |
+
"llm.model.layers.16.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
106 |
+
"llm.model.layers.16.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
107 |
+
"llm.model.layers.16.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
108 |
+
"llm.model.layers.16.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
109 |
+
"llm.model.layers.16.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
110 |
+
"llm.model.layers.16.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
111 |
+
"llm.model.layers.16.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
112 |
+
"llm.model.layers.16.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
113 |
+
"llm.model.layers.16.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
114 |
+
"llm.model.layers.16.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
115 |
+
"llm.model.layers.16.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
116 |
+
"llm.model.layers.17.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
117 |
+
"llm.model.layers.17.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
118 |
+
"llm.model.layers.17.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
119 |
+
"llm.model.layers.17.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
120 |
+
"llm.model.layers.17.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
121 |
+
"llm.model.layers.17.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
122 |
+
"llm.model.layers.17.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
123 |
+
"llm.model.layers.17.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
124 |
+
"llm.model.layers.17.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
125 |
+
"llm.model.layers.17.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
126 |
+
"llm.model.layers.17.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
127 |
+
"llm.model.layers.17.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
128 |
+
"llm.model.layers.18.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
129 |
+
"llm.model.layers.18.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
130 |
+
"llm.model.layers.18.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
131 |
+
"llm.model.layers.18.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
132 |
+
"llm.model.layers.18.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
133 |
+
"llm.model.layers.18.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
134 |
+
"llm.model.layers.18.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
135 |
+
"llm.model.layers.18.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
136 |
+
"llm.model.layers.18.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
137 |
+
"llm.model.layers.18.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
138 |
+
"llm.model.layers.18.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
139 |
+
"llm.model.layers.18.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
140 |
+
"llm.model.layers.19.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
141 |
+
"llm.model.layers.19.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
142 |
+
"llm.model.layers.19.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
143 |
+
"llm.model.layers.19.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
144 |
+
"llm.model.layers.19.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
145 |
+
"llm.model.layers.19.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
146 |
+
"llm.model.layers.19.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
147 |
+
"llm.model.layers.19.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
148 |
+
"llm.model.layers.19.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
149 |
+
"llm.model.layers.19.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
150 |
+
"llm.model.layers.19.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
151 |
+
"llm.model.layers.19.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
152 |
+
"llm.model.layers.2.input_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
153 |
+
"llm.model.layers.2.mlp.down_proj.weight": "pytorch_model-00001-of-00004.bin",
|
154 |
+
"llm.model.layers.2.mlp.gate_proj.weight": "pytorch_model-00001-of-00004.bin",
|
155 |
+
"llm.model.layers.2.mlp.up_proj.weight": "pytorch_model-00001-of-00004.bin",
|
156 |
+
"llm.model.layers.2.post_attention_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
157 |
+
"llm.model.layers.2.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
158 |
+
"llm.model.layers.2.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
159 |
+
"llm.model.layers.2.self_attn.o_proj.weight": "pytorch_model-00001-of-00004.bin",
|
160 |
+
"llm.model.layers.2.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
161 |
+
"llm.model.layers.2.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
162 |
+
"llm.model.layers.2.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
163 |
+
"llm.model.layers.2.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
164 |
+
"llm.model.layers.20.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
165 |
+
"llm.model.layers.20.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
166 |
+
"llm.model.layers.20.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
167 |
+
"llm.model.layers.20.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
168 |
+
"llm.model.layers.20.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
169 |
+
"llm.model.layers.20.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
170 |
+
"llm.model.layers.20.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
171 |
+
"llm.model.layers.20.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
172 |
+
"llm.model.layers.20.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
173 |
+
"llm.model.layers.20.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
174 |
+
"llm.model.layers.20.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
175 |
+
"llm.model.layers.20.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
176 |
+
"llm.model.layers.21.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
177 |
+
"llm.model.layers.21.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
178 |
+
"llm.model.layers.21.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
179 |
+
"llm.model.layers.21.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
180 |
+
"llm.model.layers.21.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
181 |
+
"llm.model.layers.21.self_attn.k_proj.bias": "pytorch_model-00002-of-00004.bin",
|
182 |
+
"llm.model.layers.21.self_attn.k_proj.weight": "pytorch_model-00002-of-00004.bin",
|
183 |
+
"llm.model.layers.21.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
184 |
+
"llm.model.layers.21.self_attn.q_proj.bias": "pytorch_model-00002-of-00004.bin",
|
185 |
+
"llm.model.layers.21.self_attn.q_proj.weight": "pytorch_model-00002-of-00004.bin",
|
186 |
+
"llm.model.layers.21.self_attn.v_proj.bias": "pytorch_model-00002-of-00004.bin",
|
187 |
+
"llm.model.layers.21.self_attn.v_proj.weight": "pytorch_model-00002-of-00004.bin",
|
188 |
+
"llm.model.layers.22.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
189 |
+
"llm.model.layers.22.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
190 |
+
"llm.model.layers.22.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
191 |
+
"llm.model.layers.22.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
192 |
+
"llm.model.layers.22.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
193 |
+
"llm.model.layers.22.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
194 |
+
"llm.model.layers.22.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
195 |
+
"llm.model.layers.22.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
196 |
+
"llm.model.layers.22.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
197 |
+
"llm.model.layers.22.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
198 |
+
"llm.model.layers.22.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
199 |
+
"llm.model.layers.22.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
200 |
+
"llm.model.layers.23.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
201 |
+
"llm.model.layers.23.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
202 |
+
"llm.model.layers.23.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
203 |
+
"llm.model.layers.23.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
204 |
+
"llm.model.layers.23.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
205 |
+
"llm.model.layers.23.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
206 |
+
"llm.model.layers.23.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
207 |
+
"llm.model.layers.23.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
208 |
+
"llm.model.layers.23.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
209 |
+
"llm.model.layers.23.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
210 |
+
"llm.model.layers.23.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
211 |
+
"llm.model.layers.23.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
212 |
+
"llm.model.layers.24.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
213 |
+
"llm.model.layers.24.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
214 |
+
"llm.model.layers.24.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
215 |
+
"llm.model.layers.24.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
216 |
+
"llm.model.layers.24.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
217 |
+
"llm.model.layers.24.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
218 |
+
"llm.model.layers.24.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
219 |
+
"llm.model.layers.24.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
220 |
+
"llm.model.layers.24.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
221 |
+
"llm.model.layers.24.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
222 |
+
"llm.model.layers.24.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
223 |
+
"llm.model.layers.24.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
224 |
+
"llm.model.layers.25.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
225 |
+
"llm.model.layers.25.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
226 |
+
"llm.model.layers.25.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
227 |
+
"llm.model.layers.25.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
228 |
+
"llm.model.layers.25.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
229 |
+
"llm.model.layers.25.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
230 |
+
"llm.model.layers.25.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
231 |
+
"llm.model.layers.25.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
232 |
+
"llm.model.layers.25.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
233 |
+
"llm.model.layers.25.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
234 |
+
"llm.model.layers.25.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
235 |
+
"llm.model.layers.25.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
236 |
+
"llm.model.layers.26.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
237 |
+
"llm.model.layers.26.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
238 |
+
"llm.model.layers.26.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
239 |
+
"llm.model.layers.26.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
240 |
+
"llm.model.layers.26.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
241 |
+
"llm.model.layers.26.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
242 |
+
"llm.model.layers.26.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
243 |
+
"llm.model.layers.26.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
244 |
+
"llm.model.layers.26.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
245 |
+
"llm.model.layers.26.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
246 |
+
"llm.model.layers.26.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
247 |
+
"llm.model.layers.26.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
248 |
+
"llm.model.layers.27.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
249 |
+
"llm.model.layers.27.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
250 |
+
"llm.model.layers.27.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
251 |
+
"llm.model.layers.27.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
252 |
+
"llm.model.layers.27.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
253 |
+
"llm.model.layers.27.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
254 |
+
"llm.model.layers.27.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
255 |
+
"llm.model.layers.27.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
256 |
+
"llm.model.layers.27.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
257 |
+
"llm.model.layers.27.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
258 |
+
"llm.model.layers.27.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
259 |
+
"llm.model.layers.27.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
260 |
+
"llm.model.layers.28.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
261 |
+
"llm.model.layers.28.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
262 |
+
"llm.model.layers.28.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
263 |
+
"llm.model.layers.28.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
264 |
+
"llm.model.layers.28.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
265 |
+
"llm.model.layers.28.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
266 |
+
"llm.model.layers.28.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
267 |
+
"llm.model.layers.28.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
268 |
+
"llm.model.layers.28.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
269 |
+
"llm.model.layers.28.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
270 |
+
"llm.model.layers.28.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
271 |
+
"llm.model.layers.28.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
272 |
+
"llm.model.layers.29.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
273 |
+
"llm.model.layers.29.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
274 |
+
"llm.model.layers.29.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
275 |
+
"llm.model.layers.29.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
276 |
+
"llm.model.layers.29.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
277 |
+
"llm.model.layers.29.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
278 |
+
"llm.model.layers.29.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
279 |
+
"llm.model.layers.29.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
280 |
+
"llm.model.layers.29.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
281 |
+
"llm.model.layers.29.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
282 |
+
"llm.model.layers.29.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
283 |
+
"llm.model.layers.29.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
284 |
+
"llm.model.layers.3.input_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
285 |
+
"llm.model.layers.3.mlp.down_proj.weight": "pytorch_model-00001-of-00004.bin",
|
286 |
+
"llm.model.layers.3.mlp.gate_proj.weight": "pytorch_model-00001-of-00004.bin",
|
287 |
+
"llm.model.layers.3.mlp.up_proj.weight": "pytorch_model-00001-of-00004.bin",
|
288 |
+
"llm.model.layers.3.post_attention_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
289 |
+
"llm.model.layers.3.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
290 |
+
"llm.model.layers.3.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
291 |
+
"llm.model.layers.3.self_attn.o_proj.weight": "pytorch_model-00001-of-00004.bin",
|
292 |
+
"llm.model.layers.3.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
293 |
+
"llm.model.layers.3.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
294 |
+
"llm.model.layers.3.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
295 |
+
"llm.model.layers.3.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
296 |
+
"llm.model.layers.30.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
297 |
+
"llm.model.layers.30.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
298 |
+
"llm.model.layers.30.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
299 |
+
"llm.model.layers.30.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
300 |
+
"llm.model.layers.30.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
301 |
+
"llm.model.layers.30.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
302 |
+
"llm.model.layers.30.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
303 |
+
"llm.model.layers.30.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
304 |
+
"llm.model.layers.30.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
305 |
+
"llm.model.layers.30.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
306 |
+
"llm.model.layers.30.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
307 |
+
"llm.model.layers.30.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
308 |
+
"llm.model.layers.31.input_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
309 |
+
"llm.model.layers.31.mlp.down_proj.weight": "pytorch_model-00003-of-00004.bin",
|
310 |
+
"llm.model.layers.31.mlp.gate_proj.weight": "pytorch_model-00003-of-00004.bin",
|
311 |
+
"llm.model.layers.31.mlp.up_proj.weight": "pytorch_model-00003-of-00004.bin",
|
312 |
+
"llm.model.layers.31.post_attention_layernorm.weight": "pytorch_model-00003-of-00004.bin",
|
313 |
+
"llm.model.layers.31.self_attn.k_proj.bias": "pytorch_model-00003-of-00004.bin",
|
314 |
+
"llm.model.layers.31.self_attn.k_proj.weight": "pytorch_model-00003-of-00004.bin",
|
315 |
+
"llm.model.layers.31.self_attn.o_proj.weight": "pytorch_model-00003-of-00004.bin",
|
316 |
+
"llm.model.layers.31.self_attn.q_proj.bias": "pytorch_model-00003-of-00004.bin",
|
317 |
+
"llm.model.layers.31.self_attn.q_proj.weight": "pytorch_model-00003-of-00004.bin",
|
318 |
+
"llm.model.layers.31.self_attn.v_proj.bias": "pytorch_model-00003-of-00004.bin",
|
319 |
+
"llm.model.layers.31.self_attn.v_proj.weight": "pytorch_model-00003-of-00004.bin",
|
320 |
+
"llm.model.layers.4.input_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
321 |
+
"llm.model.layers.4.mlp.down_proj.weight": "pytorch_model-00001-of-00004.bin",
|
322 |
+
"llm.model.layers.4.mlp.gate_proj.weight": "pytorch_model-00001-of-00004.bin",
|
323 |
+
"llm.model.layers.4.mlp.up_proj.weight": "pytorch_model-00001-of-00004.bin",
|
324 |
+
"llm.model.layers.4.post_attention_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
325 |
+
"llm.model.layers.4.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
326 |
+
"llm.model.layers.4.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
327 |
+
"llm.model.layers.4.self_attn.o_proj.weight": "pytorch_model-00001-of-00004.bin",
|
328 |
+
"llm.model.layers.4.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
329 |
+
"llm.model.layers.4.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
330 |
+
"llm.model.layers.4.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
331 |
+
"llm.model.layers.4.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
332 |
+
"llm.model.layers.5.input_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
333 |
+
"llm.model.layers.5.mlp.down_proj.weight": "pytorch_model-00001-of-00004.bin",
|
334 |
+
"llm.model.layers.5.mlp.gate_proj.weight": "pytorch_model-00001-of-00004.bin",
|
335 |
+
"llm.model.layers.5.mlp.up_proj.weight": "pytorch_model-00001-of-00004.bin",
|
336 |
+
"llm.model.layers.5.post_attention_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
337 |
+
"llm.model.layers.5.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
338 |
+
"llm.model.layers.5.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
339 |
+
"llm.model.layers.5.self_attn.o_proj.weight": "pytorch_model-00001-of-00004.bin",
|
340 |
+
"llm.model.layers.5.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
341 |
+
"llm.model.layers.5.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
342 |
+
"llm.model.layers.5.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
343 |
+
"llm.model.layers.5.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
344 |
+
"llm.model.layers.6.input_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
345 |
+
"llm.model.layers.6.mlp.down_proj.weight": "pytorch_model-00001-of-00004.bin",
|
346 |
+
"llm.model.layers.6.mlp.gate_proj.weight": "pytorch_model-00001-of-00004.bin",
|
347 |
+
"llm.model.layers.6.mlp.up_proj.weight": "pytorch_model-00001-of-00004.bin",
|
348 |
+
"llm.model.layers.6.post_attention_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
349 |
+
"llm.model.layers.6.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
350 |
+
"llm.model.layers.6.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
351 |
+
"llm.model.layers.6.self_attn.o_proj.weight": "pytorch_model-00001-of-00004.bin",
|
352 |
+
"llm.model.layers.6.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
353 |
+
"llm.model.layers.6.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
354 |
+
"llm.model.layers.6.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
355 |
+
"llm.model.layers.6.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
356 |
+
"llm.model.layers.7.input_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
357 |
+
"llm.model.layers.7.mlp.down_proj.weight": "pytorch_model-00001-of-00004.bin",
|
358 |
+
"llm.model.layers.7.mlp.gate_proj.weight": "pytorch_model-00001-of-00004.bin",
|
359 |
+
"llm.model.layers.7.mlp.up_proj.weight": "pytorch_model-00001-of-00004.bin",
|
360 |
+
"llm.model.layers.7.post_attention_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
361 |
+
"llm.model.layers.7.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
362 |
+
"llm.model.layers.7.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
363 |
+
"llm.model.layers.7.self_attn.o_proj.weight": "pytorch_model-00001-of-00004.bin",
|
364 |
+
"llm.model.layers.7.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
365 |
+
"llm.model.layers.7.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
366 |
+
"llm.model.layers.7.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
367 |
+
"llm.model.layers.7.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
368 |
+
"llm.model.layers.8.input_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
369 |
+
"llm.model.layers.8.mlp.down_proj.weight": "pytorch_model-00001-of-00004.bin",
|
370 |
+
"llm.model.layers.8.mlp.gate_proj.weight": "pytorch_model-00001-of-00004.bin",
|
371 |
+
"llm.model.layers.8.mlp.up_proj.weight": "pytorch_model-00001-of-00004.bin",
|
372 |
+
"llm.model.layers.8.post_attention_layernorm.weight": "pytorch_model-00001-of-00004.bin",
|
373 |
+
"llm.model.layers.8.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
374 |
+
"llm.model.layers.8.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
375 |
+
"llm.model.layers.8.self_attn.o_proj.weight": "pytorch_model-00001-of-00004.bin",
|
376 |
+
"llm.model.layers.8.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
377 |
+
"llm.model.layers.8.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
378 |
+
"llm.model.layers.8.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
379 |
+
"llm.model.layers.8.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
380 |
+
"llm.model.layers.9.input_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
381 |
+
"llm.model.layers.9.mlp.down_proj.weight": "pytorch_model-00002-of-00004.bin",
|
382 |
+
"llm.model.layers.9.mlp.gate_proj.weight": "pytorch_model-00002-of-00004.bin",
|
383 |
+
"llm.model.layers.9.mlp.up_proj.weight": "pytorch_model-00002-of-00004.bin",
|
384 |
+
"llm.model.layers.9.post_attention_layernorm.weight": "pytorch_model-00002-of-00004.bin",
|
385 |
+
"llm.model.layers.9.self_attn.k_proj.bias": "pytorch_model-00001-of-00004.bin",
|
386 |
+
"llm.model.layers.9.self_attn.k_proj.weight": "pytorch_model-00001-of-00004.bin",
|
387 |
+
"llm.model.layers.9.self_attn.o_proj.weight": "pytorch_model-00002-of-00004.bin",
|
388 |
+
"llm.model.layers.9.self_attn.q_proj.bias": "pytorch_model-00001-of-00004.bin",
|
389 |
+
"llm.model.layers.9.self_attn.q_proj.weight": "pytorch_model-00001-of-00004.bin",
|
390 |
+
"llm.model.layers.9.self_attn.v_proj.bias": "pytorch_model-00001-of-00004.bin",
|
391 |
+
"llm.model.layers.9.self_attn.v_proj.weight": "pytorch_model-00001-of-00004.bin",
|
392 |
+
"llm.model.norm.weight": "pytorch_model-00003-of-00004.bin",
|
393 |
+
"visual_tokenizer.backbone.vision_model.embeddings.class_embedding": "pytorch_model-00004-of-00004.bin",
|
394 |
+
"visual_tokenizer.backbone.vision_model.embeddings.patch_embedding.weight": "pytorch_model-00004-of-00004.bin",
|
395 |
+
"visual_tokenizer.backbone.vision_model.embeddings.position_embedding.weight": "pytorch_model-00004-of-00004.bin",
|
396 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
397 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
398 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
399 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
400 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
401 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
402 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
403 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
404 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
405 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
406 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
407 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
408 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
409 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
410 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
411 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.0.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
412 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
413 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
414 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
415 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
416 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
417 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
418 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
419 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
420 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
421 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
422 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
423 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
424 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
425 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
426 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
427 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.1.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
428 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
429 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
430 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
431 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
432 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
433 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
434 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
435 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
436 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
437 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
438 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
439 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
440 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
441 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
442 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
443 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.10.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
444 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
445 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
446 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
447 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
448 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
449 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
450 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
451 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
452 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
453 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
454 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
455 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
456 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
457 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
458 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
459 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.11.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
460 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
461 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
462 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
463 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
464 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
465 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
466 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
467 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
468 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
469 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
470 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
471 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
472 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
473 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
474 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
475 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.12.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
476 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
477 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
478 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
479 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
480 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
481 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
482 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
483 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
484 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
485 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
486 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
487 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
488 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
489 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
490 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
491 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.13.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
492 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
493 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
494 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
495 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
496 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
497 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
498 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
499 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
500 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
501 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
502 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
503 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
504 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
505 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
506 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
507 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.14.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
508 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
509 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
510 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
511 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
512 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
513 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
514 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
515 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
516 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
517 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
518 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
519 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
520 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
521 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
522 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
523 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.15.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
524 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
525 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
526 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
527 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
528 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
529 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
530 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
531 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
532 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
533 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
534 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
535 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
536 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
537 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
538 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
539 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.16.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
540 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
541 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
542 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
543 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
544 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
545 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
546 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
547 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
548 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
549 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
550 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
551 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
552 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
553 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
554 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
555 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.17.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
556 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
557 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
558 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
559 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
560 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
561 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
562 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
563 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
564 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
565 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
566 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
567 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
568 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
569 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
570 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
571 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.18.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
572 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
573 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
574 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
575 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
576 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
577 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
578 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
579 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
580 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
581 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
582 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
583 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
584 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
585 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
586 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
587 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.19.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
588 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
589 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
590 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
591 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
592 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
593 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
594 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
595 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
596 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
597 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
598 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
599 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
600 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
601 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
602 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
603 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.2.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
604 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
605 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
606 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
607 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
608 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
609 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
610 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
611 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
612 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
613 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
614 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
615 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
616 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
617 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
618 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
619 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.20.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
620 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
621 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
622 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
623 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
624 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
625 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
626 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
627 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
628 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
629 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
630 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
631 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
632 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
633 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
634 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
635 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.21.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
636 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
637 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
638 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
639 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
640 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
641 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
642 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
643 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
644 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
645 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
646 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
647 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
648 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
649 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
650 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
651 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.22.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
652 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
653 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
654 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
655 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
656 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
657 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
658 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
659 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
660 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
661 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
662 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
663 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
664 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
665 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
666 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
667 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.23.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
668 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
669 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
670 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
671 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
672 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
673 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
674 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
675 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
676 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
677 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
678 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
679 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
680 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
681 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
682 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
683 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.3.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
684 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
685 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
686 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
687 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
688 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
689 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
690 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
691 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
692 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
693 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
694 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
695 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
696 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
697 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
698 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
699 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.4.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
700 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
701 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
702 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
703 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
704 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
705 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
706 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
707 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
708 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
709 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
710 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
711 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
712 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
713 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
714 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
715 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.5.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
716 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
717 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
718 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
719 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
720 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
721 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
722 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
723 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
724 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
725 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
726 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
727 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
728 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
729 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
730 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
731 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.6.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
732 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
733 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
734 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
735 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
736 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
737 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
738 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
739 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
740 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
741 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
742 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
743 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
744 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
745 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
746 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
747 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.7.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
748 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
749 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
750 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
751 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
752 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
753 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
754 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
755 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
756 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
757 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
758 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
759 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
760 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
761 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
762 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
763 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.8.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
764 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.layer_norm1.bias": "pytorch_model-00004-of-00004.bin",
|
765 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.layer_norm1.weight": "pytorch_model-00004-of-00004.bin",
|
766 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.layer_norm2.bias": "pytorch_model-00004-of-00004.bin",
|
767 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.layer_norm2.weight": "pytorch_model-00004-of-00004.bin",
|
768 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.mlp.fc1.bias": "pytorch_model-00004-of-00004.bin",
|
769 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.mlp.fc1.weight": "pytorch_model-00004-of-00004.bin",
|
770 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.mlp.fc2.bias": "pytorch_model-00004-of-00004.bin",
|
771 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.mlp.fc2.weight": "pytorch_model-00004-of-00004.bin",
|
772 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.self_attn.k_proj.bias": "pytorch_model-00004-of-00004.bin",
|
773 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.self_attn.k_proj.weight": "pytorch_model-00004-of-00004.bin",
|
774 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.self_attn.out_proj.bias": "pytorch_model-00004-of-00004.bin",
|
775 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.self_attn.out_proj.weight": "pytorch_model-00004-of-00004.bin",
|
776 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.self_attn.q_proj.bias": "pytorch_model-00004-of-00004.bin",
|
777 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.self_attn.q_proj.weight": "pytorch_model-00004-of-00004.bin",
|
778 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.self_attn.v_proj.bias": "pytorch_model-00004-of-00004.bin",
|
779 |
+
"visual_tokenizer.backbone.vision_model.encoder.layers.9.self_attn.v_proj.weight": "pytorch_model-00004-of-00004.bin",
|
780 |
+
"visual_tokenizer.backbone.vision_model.post_layernorm.bias": "pytorch_model-00004-of-00004.bin",
|
781 |
+
"visual_tokenizer.backbone.vision_model.post_layernorm.weight": "pytorch_model-00004-of-00004.bin",
|
782 |
+
"visual_tokenizer.backbone.vision_model.pre_layrnorm.bias": "pytorch_model-00004-of-00004.bin",
|
783 |
+
"visual_tokenizer.backbone.vision_model.pre_layrnorm.weight": "pytorch_model-00004-of-00004.bin",
|
784 |
+
"visual_tokenizer.head.0.weight": "pytorch_model-00004-of-00004.bin",
|
785 |
+
"visual_tokenizer.head.1.bias": "pytorch_model-00004-of-00004.bin",
|
786 |
+
"visual_tokenizer.head.1.weight": "pytorch_model-00004-of-00004.bin",
|
787 |
+
"vte.weight": "pytorch_model-00004-of-00004.bin"
|
788 |
+
}
|
789 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<|im_start|>",
|
4 |
+
"<|im_end|>"
|
5 |
+
],
|
6 |
+
"eos_token": {
|
7 |
+
"content": "<|im_end|>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false
|
12 |
+
},
|
13 |
+
"pad_token": {
|
14 |
+
"content": "<|endoftext|>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
}
|
20 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"added_tokens_decoder": {
|
4 |
+
"151643": {
|
5 |
+
"content": "<|endoftext|>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": false,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false,
|
10 |
+
"special": true
|
11 |
+
},
|
12 |
+
"151644": {
|
13 |
+
"content": "<|im_start|>",
|
14 |
+
"lstrip": false,
|
15 |
+
"normalized": false,
|
16 |
+
"rstrip": false,
|
17 |
+
"single_word": false,
|
18 |
+
"special": true
|
19 |
+
},
|
20 |
+
"151645": {
|
21 |
+
"content": "<|im_end|>",
|
22 |
+
"lstrip": false,
|
23 |
+
"normalized": false,
|
24 |
+
"rstrip": false,
|
25 |
+
"single_word": false,
|
26 |
+
"special": true
|
27 |
+
}
|
28 |
+
},
|
29 |
+
"additional_special_tokens": [
|
30 |
+
"<|im_start|>",
|
31 |
+
"<|im_end|>"
|
32 |
+
],
|
33 |
+
"bos_token": null,
|
34 |
+
"chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
35 |
+
"clean_up_tokenization_spaces": false,
|
36 |
+
"eos_token": "<|im_end|>",
|
37 |
+
"errors": "replace",
|
38 |
+
"model_max_length": 32768,
|
39 |
+
"pad_token": "<|endoftext|>",
|
40 |
+
"split_special_tokens": false,
|
41 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
42 |
+
"unk_token": null
|
43 |
+
}
|
utils.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from importlib import import_module
|
3 |
+
|
4 |
+
# Model Constants
|
5 |
+
IGNORE_INDEX = -100
|
6 |
+
IMAGE_TOKEN_INDEX = -200
|
7 |
+
IMAGE_TOKEN = "<image>"
|
8 |
+
|
9 |
+
# Log & Print
|
10 |
+
BEGIN_LINE = '========================************========================'
|
11 |
+
END_LINE = '------------------------------------------------------------'
|
12 |
+
|
13 |
+
|
14 |
+
def rank0_print(*args):
|
15 |
+
if int(os.getenv("LOCAL_PROCESS_RANK", os.getenv("LOCAL_RANK", 0))) == 0:
|
16 |
+
print(*args)
|
17 |
+
|
18 |
+
|
19 |
+
def smart_unit(num):
|
20 |
+
if num / 1.0e9 >= 1:
|
21 |
+
return f'{num / 1.0e9:.2f}B'
|
22 |
+
else:
|
23 |
+
return f'{num / 1.0e6:.2f}M'
|
24 |
+
|
25 |
+
|
26 |
+
def import_class_from_string(full_class_string):
|
27 |
+
# Split the path to get separate module and class names
|
28 |
+
module_path, _, class_name = full_class_string.rpartition('.')
|
29 |
+
|
30 |
+
# Import the module using the module path
|
31 |
+
module = import_module(module_path)
|
32 |
+
|
33 |
+
# Get the class from the imported module
|
34 |
+
cls = getattr(module, class_name)
|
35 |
+
return cls
|
visual_tokenizer.py
ADDED
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datetime import datetime
|
2 |
+
from typing import Dict, Union, Optional
|
3 |
+
|
4 |
+
import deepspeed
|
5 |
+
import torch
|
6 |
+
import PIL.Image
|
7 |
+
from torch.nn.functional import softmax, gumbel_softmax
|
8 |
+
from torch import Tensor
|
9 |
+
from transformers import PretrainedConfig, PreTrainedModel, AutoImageProcessor, AutoConfig, AutoModel
|
10 |
+
from transformers import CLIPVisionModel, CLIPImageProcessor
|
11 |
+
from transformers.integrations import is_deepspeed_zero3_enabled
|
12 |
+
|
13 |
+
from .utils import BEGIN_LINE, END_LINE, rank0_print
|
14 |
+
|
15 |
+
MODEL_TYPE = "clip_visual_tokenizer"
|
16 |
+
|
17 |
+
|
18 |
+
class BaseVisualTokenizerConfig(PretrainedConfig):
|
19 |
+
def __init__(self,
|
20 |
+
vocab_size=16384,
|
21 |
+
tokenize_function="softmax",
|
22 |
+
tau=1.0,
|
23 |
+
depths=None,
|
24 |
+
use_indicators=False,
|
25 |
+
drop_cls_token=False,
|
26 |
+
backbone_config: Optional[Union[PretrainedConfig, dict]] = None,
|
27 |
+
hidden_stride: int = 1,
|
28 |
+
**kwargs):
|
29 |
+
super().__init__(**kwargs)
|
30 |
+
self.vocab_size = vocab_size
|
31 |
+
self.tokenize_function = tokenize_function
|
32 |
+
self.tau = tau
|
33 |
+
if isinstance(depths, str):
|
34 |
+
depths = [int(x) for x in depths.split('|')]
|
35 |
+
self.depths = depths
|
36 |
+
self.backbone_kwargs = {}
|
37 |
+
self.use_indicators = use_indicators
|
38 |
+
self.drop_cls_token = drop_cls_token
|
39 |
+
if backbone_config is not None:
|
40 |
+
assert isinstance(backbone_config, (PretrainedConfig, dict)), \
|
41 |
+
f"expect `backbone_config` to be instance of PretrainedConfig or dict, but got {type(backbone_config)} type"
|
42 |
+
if not isinstance(backbone_config, PretrainedConfig):
|
43 |
+
model_type = backbone_config['model_type']
|
44 |
+
backbone_config.pop('model_type')
|
45 |
+
backbone_config = AutoConfig.for_model(model_type, **backbone_config)
|
46 |
+
self.backbone_config = backbone_config
|
47 |
+
self.hidden_stride = hidden_stride
|
48 |
+
|
49 |
+
|
50 |
+
class BaseVisualTokenizer(PreTrainedModel):
|
51 |
+
base_model_prefix = "backbone"
|
52 |
+
main_input_name = None
|
53 |
+
_image_processor_class = None
|
54 |
+
_image_processor_kwargs = {}
|
55 |
+
_backbone_class = None
|
56 |
+
_backbone_name_or_path = None
|
57 |
+
|
58 |
+
def __init__(self, config: BaseVisualTokenizerConfig, *inputs, **kwargs):
|
59 |
+
super().__init__(config, *inputs, **kwargs)
|
60 |
+
if kwargs.get('train_from_scratch'):
|
61 |
+
self.image_processor = self._image_processor_class.from_pretrained(self._backbone_name_or_path,
|
62 |
+
**self._image_processor_kwargs)
|
63 |
+
self.backbone = self._backbone_class.from_pretrained(self._backbone_name_or_path,
|
64 |
+
**self.config.backbone_kwargs)
|
65 |
+
self.config.backbone_config = self.backbone.config
|
66 |
+
else:
|
67 |
+
self.image_processor = AutoImageProcessor.from_pretrained(kwargs['image_processor_name_or_path'])
|
68 |
+
self.backbone = AutoModel.from_config(self.config.backbone_config)
|
69 |
+
self.head = None
|
70 |
+
|
71 |
+
assert all((self.image_processor.do_resize,
|
72 |
+
not getattr(self.image_processor, 'do_center_crop', False),
|
73 |
+
self.image_processor.do_rescale,
|
74 |
+
self.image_processor.do_normalize
|
75 |
+
)), f"image_processor `{self.image_processor}` is not supported currently"
|
76 |
+
|
77 |
+
def get_backbone(self):
|
78 |
+
return self.backbone
|
79 |
+
|
80 |
+
def get_monitor_tensors(self):
|
81 |
+
raise NotImplementedError
|
82 |
+
|
83 |
+
def get_image_processor(self):
|
84 |
+
return self.image_processor
|
85 |
+
|
86 |
+
def get_head(self):
|
87 |
+
return self.head
|
88 |
+
|
89 |
+
def get_image_size(self):
|
90 |
+
raise NotImplementedError
|
91 |
+
|
92 |
+
def preprocess_image(self, image: PIL.Image.Image, convert_to_rgb=True):
|
93 |
+
if convert_to_rgb and image.mode != 'RGB':
|
94 |
+
image = image.convert('RGB')
|
95 |
+
|
96 |
+
# first resize and preprocess
|
97 |
+
sides = self.get_image_size()
|
98 |
+
if sides[0] != sides[1]:
|
99 |
+
raise ValueError('get_image_size() returns non-square size')
|
100 |
+
side = sides[0]
|
101 |
+
|
102 |
+
width, height = image.size
|
103 |
+
if width == height:
|
104 |
+
new_width = new_height = side
|
105 |
+
elif width > height:
|
106 |
+
new_width = side
|
107 |
+
new_height = int(height / width * new_width)
|
108 |
+
else:
|
109 |
+
new_height = side
|
110 |
+
new_width = int(width / height * new_height)
|
111 |
+
new_size = dict(height=new_height, width=new_width)
|
112 |
+
pixel_values = self.image_processor.preprocess(image, size=new_size, return_tensors='pt')['pixel_values']
|
113 |
+
|
114 |
+
# then pad to square
|
115 |
+
square_values = torch.zeros([1, 3, side, side], dtype=pixel_values.dtype, device=pixel_values.device)
|
116 |
+
new_height, new_width = pixel_values.shape[2:]
|
117 |
+
if new_height == new_width:
|
118 |
+
square_values[:, :, :, :] = pixel_values
|
119 |
+
elif new_height > new_width:
|
120 |
+
from_index = (side - new_width) // 2
|
121 |
+
square_values[:, :, :, from_index:from_index + new_width] = pixel_values
|
122 |
+
else:
|
123 |
+
from_index = (side - new_height) // 2
|
124 |
+
square_values[:, :, from_index:from_index + new_height, :] = pixel_values
|
125 |
+
|
126 |
+
return square_values
|
127 |
+
|
128 |
+
def get_layer_norm(self):
|
129 |
+
return self.layer_norm
|
130 |
+
|
131 |
+
def tokenize(self, logits):
|
132 |
+
def st_argmax(y_soft, dim): # straight-through softmax
|
133 |
+
index = y_soft.max(dim, keepdim=True)[1]
|
134 |
+
y_hard = torch.zeros_like(y_soft, memory_format=torch.legacy_contiguous_format).scatter_(dim, index, 1.0)
|
135 |
+
ret = y_hard - y_soft.detach() + y_soft
|
136 |
+
return ret
|
137 |
+
|
138 |
+
if self.config.tokenize_function == 'softmax':
|
139 |
+
tokens = softmax(logits, dim=-1)
|
140 |
+
elif self.config.tokenize_function == 'gumbel_argmax':
|
141 |
+
tokens = gumbel_softmax(logits, tau=self.config.tau, hard=True)
|
142 |
+
elif self.config.tokenize_function == 'st_argmax':
|
143 |
+
tokens = st_argmax(logits, dim=-1)
|
144 |
+
else:
|
145 |
+
raise ValueError(
|
146 |
+
f'Invalid `max_type`, expected softmax or gumbel_argmax or st_argmax, but got {self.config.tokenize_function}')
|
147 |
+
return tokens
|
148 |
+
|
149 |
+
|
150 |
+
|
151 |
+
class ClipVisualTokenizerConfig(BaseVisualTokenizerConfig):
|
152 |
+
model_type = MODEL_TYPE
|
153 |
+
|
154 |
+
def __init__(self, **kwargs):
|
155 |
+
super().__init__(**kwargs)
|
156 |
+
if self.depths:
|
157 |
+
assert len(self.depths) == 1
|
158 |
+
self.backbone_kwargs['num_hidden_layers'] = self.depths[0]
|
159 |
+
|
160 |
+
|
161 |
+
class ClipVisualTokenizer(BaseVisualTokenizer):
|
162 |
+
config_class = ClipVisualTokenizerConfig
|
163 |
+
supports_gradient_checkpointing = True
|
164 |
+
_no_split_modules = ["CLIPEncoderLayer"]
|
165 |
+
_image_processor_class = CLIPImageProcessor
|
166 |
+
_image_processor_kwargs = dict(do_center_crop=False)
|
167 |
+
_backbone_class = CLIPVisionModel
|
168 |
+
_backbone_name_or_path = "openai/clip-vit-large-patch14-336"
|
169 |
+
|
170 |
+
def __init__(self, config: ClipVisualTokenizerConfig = None, *inputs, **kwargs):
|
171 |
+
super().__init__(config, *inputs, **kwargs)
|
172 |
+
head_dim = self.config.vocab_size
|
173 |
+
if self.config.use_indicators:
|
174 |
+
head_dim -= 2 # reserved for two image indicator tokens
|
175 |
+
self.head = torch.nn.Sequential(
|
176 |
+
torch.nn.Linear(self.backbone.config.hidden_size, head_dim, bias=False),
|
177 |
+
torch.nn.LayerNorm(head_dim)
|
178 |
+
)
|
179 |
+
|
180 |
+
def re_init_layers(self, re_init_layer_begin):
|
181 |
+
layer_dict = self.get_re_init_layer_dict(re_init_layer_begin)
|
182 |
+
for name, layer in layer_dict.items():
|
183 |
+
rank0_print(BEGIN_LINE)
|
184 |
+
rank0_print(f'[{datetime.now()}] Before layer re-initialization of {name}: ')
|
185 |
+
for k, v in layer.named_parameters():
|
186 |
+
with deepspeed.zero.GatheredParameters([v]):
|
187 |
+
rank0_print(f'{k}: {v}')
|
188 |
+
with deepspeed.zero.GatheredParameters(list(layer.parameters(recurse=True)), modifier_rank=0):
|
189 |
+
if not is_deepspeed_zero3_enabled() or deepspeed.comm.get_rank() == 0:
|
190 |
+
layer.apply(self.backbone._init_weights)
|
191 |
+
rank0_print(f'[{datetime.now()}] After layer re-initialization of {name}:')
|
192 |
+
for k, v in layer.named_parameters():
|
193 |
+
with deepspeed.zero.GatheredParameters([v]):
|
194 |
+
rank0_print(f'{k}: {v}')
|
195 |
+
rank0_print(END_LINE)
|
196 |
+
|
197 |
+
def get_re_init_layer_dict(self, re_init_layer_begin: int) -> Dict[str, torch.nn.Module]:
|
198 |
+
assert re_init_layer_begin >= 0, "negative index is prohibited"
|
199 |
+
layer_dict = dict()
|
200 |
+
for i in range(re_init_layer_begin, self.backbone.config.num_hidden_layers):
|
201 |
+
layer_dict[f'backbone.vision_model.encoder.layers.{i}'] = self.backbone.vision_model.encoder.layers[i]
|
202 |
+
return layer_dict
|
203 |
+
|
204 |
+
def get_monitor_tensors(self):
|
205 |
+
return dict(
|
206 |
+
backbone_bottom=self.backbone.vision_model.encoder.layers[0].self_attn.k_proj.weight,
|
207 |
+
backbone_top=self.backbone.vision_model.encoder.layers[-1].self_attn.out_proj.weight,
|
208 |
+
head=self.head[0].weight
|
209 |
+
)
|
210 |
+
|
211 |
+
def get_image_size(self):
|
212 |
+
height = self.image_processor.crop_size["height"]
|
213 |
+
width = self.image_processor.crop_size["width"]
|
214 |
+
return height, width
|
215 |
+
|
216 |
+
def forward(self, pixel_values) -> Tensor: # [BatchSize, ImageShape] -> [BatchSize, #Token, VocabSize]
|
217 |
+
output = self.backbone(
|
218 |
+
pixel_values, output_hidden_states=True, return_dict=True)
|
219 |
+
features = output.last_hidden_state
|
220 |
+
if self.config.drop_cls_token:
|
221 |
+
features = features[:, 1:, :]
|
222 |
+
logits = self.head(features)
|
223 |
+
tokens = self.tokenize(logits)
|
224 |
+
if self.config.use_indicators:
|
225 |
+
# tokens' shape is [BatchSize, #Token, VocabSize-2], so padding with [BatchSize, #Token, 2], after
|
226 |
+
# which, tokens' shape should become [BatchSize, #Token, VocabSize]
|
227 |
+
batch_size, token_len, _ = tokens.shape
|
228 |
+
padding_tensor = torch.zeros(size=(batch_size, token_len, 2),
|
229 |
+
dtype=tokens.dtype,
|
230 |
+
device=tokens.device,
|
231 |
+
layout=tokens.layout,
|
232 |
+
requires_grad=False)
|
233 |
+
tokens = torch.cat((tokens, padding_tensor), dim=2)
|
234 |
+
|
235 |
+
# adding indicator tokens, after which tokens' shape should become [BatchSize, 1+#Token+1, VocabSize]
|
236 |
+
begin_indicator = torch.zeros(size=(batch_size, 1),
|
237 |
+
dtype=torch.long,
|
238 |
+
device=tokens.device,
|
239 |
+
requires_grad=False) + self.config.vocab_size - 2
|
240 |
+
begin_indicator_token = torch.nn.functional.one_hot(begin_indicator,
|
241 |
+
num_classes=self.config.vocab_size).to(
|
242 |
+
dtype=tokens.dtype)
|
243 |
+
end_indicator = torch.zeros(size=(batch_size, 1),
|
244 |
+
dtype=torch.long,
|
245 |
+
device=tokens.device,
|
246 |
+
requires_grad=False) + self.config.vocab_size - 1
|
247 |
+
end_indicator_token = torch.nn.functional.one_hot(end_indicator,
|
248 |
+
num_classes=self.config.vocab_size).to(dtype=tokens.dtype)
|
249 |
+
tokens = torch.cat((begin_indicator_token, tokens, end_indicator_token), dim=1)
|
250 |
+
return tokens
|
251 |
+
|
252 |
+
|
253 |
+
AutoConfig.register(MODEL_TYPE, ClipVisualTokenizerConfig)
|
254 |
+
AutoModel.register(ClipVisualTokenizerConfig, ClipVisualTokenizer)
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|