Upload folder using huggingface_hub
Browse files- config.json +73 -0
- configuration_opencua.py +38 -0
- generation_config.json +8 -0
- model-1-of-30.safetensors +3 -0
- model-10-of-30.safetensors +3 -0
- model-11-of-30.safetensors +3 -0
- model-12-of-30.safetensors +3 -0
- model-13-of-30.safetensors +3 -0
- model-14-of-30.safetensors +3 -0
- model-15-of-30.safetensors +3 -0
- model-16-of-30.safetensors +3 -0
- model-17-of-30.safetensors +3 -0
- model-18-of-30.safetensors +3 -0
- model-19-of-30.safetensors +3 -0
- model-2-of-30.safetensors +3 -0
- model-20-of-30.safetensors +3 -0
- model-21-of-30.safetensors +3 -0
- model-22-of-30.safetensors +3 -0
- model-23-of-30.safetensors +3 -0
- model-24-of-30.safetensors +3 -0
- model-25-of-30.safetensors +3 -0
- model-26-of-30.safetensors +3 -0
- model-27-of-30.safetensors +3 -0
- model-28-of-30.safetensors +3 -0
- model-29-of-30.safetensors +3 -0
- model-3-of-30.safetensors +3 -0
- model-30-of-30.safetensors +3 -0
- model-4-of-30.safetensors +3 -0
- model-5-of-30.safetensors +3 -0
- model-6-of-30.safetensors +3 -0
- model-7-of-30.safetensors +3 -0
- model-8-of-30.safetensors +3 -0
- model-9-of-30.safetensors +3 -0
- model.safetensors.index.json +736 -0
- modeling_opencua.py +499 -0
- preprocessor_config.json +18 -0
- processing_opencua.py +270 -0
- tiktoken.model +3 -0
- tokenization_opencua.py +367 -0
- tokenizer_config.json +234 -0
config.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"OpenCUAForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"auto_map": {
|
| 6 |
+
"AutoConfig": "configuration_opencua.OpenCUAConfig",
|
| 7 |
+
"AutoModel": "modeling_opencua.OpenCUAForConditionalGeneration",
|
| 8 |
+
"AutoModelForCausalLM": "modeling_opencua.OpenCUAForConditionalGeneration",
|
| 9 |
+
"AutoProcessor": "processing_opencua.OpenCUAProcessor"
|
| 10 |
+
},
|
| 11 |
+
"ignore_index": -100,
|
| 12 |
+
"media_placeholder_token_id": 151664,
|
| 13 |
+
"model_type": "opencua",
|
| 14 |
+
"pad_token_id": 0,
|
| 15 |
+
"num_attention_heads": 28,
|
| 16 |
+
"max_position_embeddings": 128000,
|
| 17 |
+
"text_config": {
|
| 18 |
+
"bos_token_id": 151643,
|
| 19 |
+
"eos_token_id": 151644,
|
| 20 |
+
"head_dim": 128,
|
| 21 |
+
"hidden_act": "silu",
|
| 22 |
+
"hidden_size": 3584,
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 18944,
|
| 25 |
+
"k_proj_bias": true,
|
| 26 |
+
"max_length": 20,
|
| 27 |
+
"min_length": 0,
|
| 28 |
+
"model_type": "qwen2",
|
| 29 |
+
"num_attention_heads": 28,
|
| 30 |
+
"num_beam_groups": 1,
|
| 31 |
+
"num_beams": 1,
|
| 32 |
+
"num_hidden_layers": 28,
|
| 33 |
+
"num_key_value_heads": 4,
|
| 34 |
+
"pad_token_id": 152063,
|
| 35 |
+
"max_position_embeddings": 128000,
|
| 36 |
+
"pretraining_sequence_length": 128000,
|
| 37 |
+
"q_proj_bias": true,
|
| 38 |
+
"rms_norm_eps": 1e-05,
|
| 39 |
+
"rope_theta": 1000000.0,
|
| 40 |
+
"tie_word_embeddings": false,
|
| 41 |
+
"torch_dtype": "bfloat16",
|
| 42 |
+
"use_bfloat16": false,
|
| 43 |
+
"use_cache": true,
|
| 44 |
+
"v_proj_bias": true,
|
| 45 |
+
"vocab_size": 152064
|
| 46 |
+
},
|
| 47 |
+
"tie_word_embeddings": false,
|
| 48 |
+
"torch_dtype": "bfloat16",
|
| 49 |
+
"transformers_version": "4.48.3",
|
| 50 |
+
"vision_config": {
|
| 51 |
+
"depth": 32,
|
| 52 |
+
"fullatt_block_indexes": [
|
| 53 |
+
7,
|
| 54 |
+
15,
|
| 55 |
+
23,
|
| 56 |
+
31
|
| 57 |
+
],
|
| 58 |
+
"hidden_act": "silu",
|
| 59 |
+
"hidden_size": 1280,
|
| 60 |
+
"num_heads": 16,
|
| 61 |
+
"in_chans": 3,
|
| 62 |
+
"intermediate_size": 3420,
|
| 63 |
+
|
| 64 |
+
"patch_size": 14,
|
| 65 |
+
"spatial_merge_size": 2,
|
| 66 |
+
"spatial_patch_size": 14,
|
| 67 |
+
"temporal_patch_size": 2,
|
| 68 |
+
"out_hidden_size": 3584,
|
| 69 |
+
"tokens_per_second": 2,
|
| 70 |
+
"window_size": 112
|
| 71 |
+
},
|
| 72 |
+
"vocab_size": 152064
|
| 73 |
+
}
|
configuration_opencua.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 2 |
+
from transformers.models.qwen2_5_vl.configuration_qwen2_5_vl import Qwen2_5_VLVisionConfig
|
| 3 |
+
from transformers.models.qwen2.configuration_qwen2 import Qwen2Config
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class OpenCUAConfig(PretrainedConfig):
|
| 7 |
+
"""OpenCUA-2.5-7B model configuration.
|
| 8 |
+
|
| 9 |
+
Args:
|
| 10 |
+
vision_config: Configuration for the vision model.Qwen2_5_VLVisionConfig
|
| 11 |
+
text_config: Configuration for the text model. Qwen2Config
|
| 12 |
+
pad_token_id: The token ID to use for padding.
|
| 13 |
+
"""
|
| 14 |
+
|
| 15 |
+
model_type = "opencua"
|
| 16 |
+
|
| 17 |
+
def __init__(
|
| 18 |
+
self,
|
| 19 |
+
vision_config: dict | Qwen2_5_VLVisionConfig | None = None,
|
| 20 |
+
text_config: dict | Qwen2Config | None = None,
|
| 21 |
+
ignore_index: int = -100,
|
| 22 |
+
media_placeholder_token_id: int = 151664,
|
| 23 |
+
pad_token_id: int = 0,
|
| 24 |
+
**kwargs
|
| 25 |
+
):
|
| 26 |
+
if isinstance(vision_config, dict):
|
| 27 |
+
vision_config = Qwen2_5_VLVisionConfig(**vision_config)
|
| 28 |
+
self.vision_config = vision_config
|
| 29 |
+
|
| 30 |
+
if isinstance(text_config, dict):
|
| 31 |
+
text_config = Qwen2Config(**text_config)
|
| 32 |
+
self.text_config = text_config
|
| 33 |
+
|
| 34 |
+
self.ignore_index = ignore_index
|
| 35 |
+
self.media_placeholder_token_id = media_placeholder_token_id
|
| 36 |
+
|
| 37 |
+
super().__init__(pad_token_id=pad_token_id, **kwargs)
|
| 38 |
+
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_length": 32768,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
151645,
|
| 5 |
+
151644,
|
| 6 |
+
151643
|
| 7 |
+
]
|
| 8 |
+
}
|
model-1-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a3d6b25647e2b587c73a4218d486fdcfe871841db79484f07a7923677e525473
|
| 3 |
+
size 466117136
|
model-10-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:adf476ad9901a23367b16985ead74683a3aafc385ecf1d99a6b28ca21cfe703e
|
| 3 |
+
size 466117136
|
model-11-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a9fa2d9cf00f3f7f821b5b4d54dd7eb6b4084400fdafb8078578f0d07917e22
|
| 3 |
+
size 466117144
|
model-12-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb0e67d7bbd78437081171464a0c7c57f1549a9090a2fb42dc73b19d94fba495
|
| 3 |
+
size 466117144
|
model-13-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2dca2c5bf93a7d4563915e8c54bd1c93741180de3faaa8b8834846e253e557fb
|
| 3 |
+
size 466117144
|
model-14-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3e001b216b79438b4a69224bff91c35c4fc6ba9dc78dcda93294f193376f893c
|
| 3 |
+
size 466117144
|
model-15-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a703f939c1760c207526014edcae70d85f07e9f565f2875a155c4b9299378cf7
|
| 3 |
+
size 466117144
|
model-16-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bfd82bf2141a4fb0e11d79938d1b2ac14369677d9a27e42a30de772fa9f27e5e
|
| 3 |
+
size 466117144
|
model-17-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35cee47e7c5a95bd5f12616f42038c9afefc4b5630046da6a28147a1f0599d75
|
| 3 |
+
size 466117144
|
model-18-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:017dddcd4ace4d3e05c4be011033d73c68e1106a15c9ecd3a95ce352e70cd295
|
| 3 |
+
size 466117144
|
model-19-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02dcdc01ebcdd1c35cbf1d072e1a20eaa82730dd3858a0ab8df6f469b4b6c97f
|
| 3 |
+
size 466117144
|
model-2-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46203fb402929e58025550b29692df1c3784cac2dab3ba8bf0ab3d12dfd3cb0e
|
| 3 |
+
size 466117136
|
model-20-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:231f45b7d467015e9777cb32fd6c601221c6fcc37861bbaf051a924212d7ddb1
|
| 3 |
+
size 466117144
|
model-21-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a21d6b0a76dcc9d5d8a6eb78d37c63417a42ca15da427be916ec8d542ea8a079
|
| 3 |
+
size 466117144
|
model-22-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc0b4cac4165f88c8730a9f28fb7ea1cf42f6ce7177206968f81df95777eca97
|
| 3 |
+
size 466117144
|
model-23-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae7247b476ac2b9c13ca49b9fe898625f5a319bb736e9c1257223db296559811
|
| 3 |
+
size 466117144
|
model-24-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0a57eaed9ad51ee020baae852de06fa03670fb4060bb0b40912f50ee31d02260
|
| 3 |
+
size 466117144
|
model-25-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:23bad1d324b717a327481d9c8e10eb3029dc9e92ef578d826c88e7ba6b12e716
|
| 3 |
+
size 466117144
|
model-26-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae5739717c8ddf2a9d70affe8c06f6f76d7fc4b2c52c9646ab921a0fa73c2668
|
| 3 |
+
size 466117144
|
model-27-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:95c6612dbb6b658237a43f40957c5262800fb9e71c1fc94b0ab0b4fc5e78551c
|
| 3 |
+
size 466117144
|
model-28-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c88af7b77c1fc7766c6ca6f5aaa1c02071f5de4393981dbddbc74eddd2c1e04b
|
| 3 |
+
size 466117144
|
model-29-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2709f5ac915b7e5ac5eef2e95c521025d46d2cfd16de34a61f88b3c5b5692f3a
|
| 3 |
+
size 2179997040
|
model-3-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:68c5f3751c6e4c5191c66d1004ef0207a17f1278f925851ea8b59ea5b6d6707a
|
| 3 |
+
size 466117136
|
model-30-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f01ab69ff0ebeb39e0aed61cff54f76c41a05af328086ecaff487f1bb62c2263
|
| 3 |
+
size 1353144368
|
model-4-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69a5868b7982fc9a31296cfc995e374ca749dd223139f9058ffd758675da1c4c
|
| 3 |
+
size 466117136
|
model-5-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f68200835873dc96c23eb15b7e700b6220e91d395650fe2dc69f67232b743470
|
| 3 |
+
size 466117136
|
model-6-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:01b17e6b830001e47f06f1dc3044604a5f930083f36c0f7d54b66a7aa4ba2ba4
|
| 3 |
+
size 466117136
|
model-7-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d57910cb8778491b512099d2541944c619fe51121d03183e7c1dda401f5425dc
|
| 3 |
+
size 466117136
|
model-8-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:851747abf0fd9c150c7cfbcae4a6b0d0e2b307f2a421467abf7ed290cc8fabd7
|
| 3 |
+
size 466117136
|
model-9-of-30.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db02221c8b90a246e0582908af17af6d1f12d6ccce6b7c1c5b6902bc5f7977bf
|
| 3 |
+
size 466117136
|
model.safetensors.index.json
ADDED
|
@@ -0,0 +1,736 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_size": 16584333312
|
| 4 |
+
},
|
| 5 |
+
"weight_map": {
|
| 6 |
+
"language_model.model.layers.19.self_attn.k_proj.bias": "model-20-of-30.safetensors",
|
| 7 |
+
"language_model.model.layers.19.self_attn.q_proj.bias": "model-20-of-30.safetensors",
|
| 8 |
+
"language_model.model.layers.19.self_attn.k_proj.weight": "model-20-of-30.safetensors",
|
| 9 |
+
"language_model.model.layers.19.self_attn.q_proj.weight": "model-20-of-30.safetensors",
|
| 10 |
+
"language_model.model.layers.19.mlp.up_proj.weight": "model-20-of-30.safetensors",
|
| 11 |
+
"language_model.model.layers.19.mlp.down_proj.weight": "model-20-of-30.safetensors",
|
| 12 |
+
"language_model.model.layers.19.mlp.gate_proj.weight": "model-20-of-30.safetensors",
|
| 13 |
+
"language_model.model.layers.19.post_attention_layernorm.weight": "model-20-of-30.safetensors",
|
| 14 |
+
"language_model.model.layers.19.input_layernorm.weight": "model-20-of-30.safetensors",
|
| 15 |
+
"language_model.model.layers.19.self_attn.v_proj.bias": "model-20-of-30.safetensors",
|
| 16 |
+
"language_model.model.layers.19.self_attn.o_proj.weight": "model-20-of-30.safetensors",
|
| 17 |
+
"language_model.model.layers.19.self_attn.v_proj.weight": "model-20-of-30.safetensors",
|
| 18 |
+
"language_model.model.layers.12.self_attn.k_proj.bias": "model-13-of-30.safetensors",
|
| 19 |
+
"language_model.model.layers.12.self_attn.q_proj.bias": "model-13-of-30.safetensors",
|
| 20 |
+
"language_model.model.layers.12.self_attn.k_proj.weight": "model-13-of-30.safetensors",
|
| 21 |
+
"language_model.model.layers.12.self_attn.q_proj.weight": "model-13-of-30.safetensors",
|
| 22 |
+
"language_model.model.layers.12.mlp.up_proj.weight": "model-13-of-30.safetensors",
|
| 23 |
+
"language_model.model.layers.12.mlp.down_proj.weight": "model-13-of-30.safetensors",
|
| 24 |
+
"language_model.model.layers.12.mlp.gate_proj.weight": "model-13-of-30.safetensors",
|
| 25 |
+
"language_model.model.layers.12.post_attention_layernorm.weight": "model-13-of-30.safetensors",
|
| 26 |
+
"language_model.model.layers.12.input_layernorm.weight": "model-13-of-30.safetensors",
|
| 27 |
+
"language_model.model.layers.12.self_attn.v_proj.bias": "model-13-of-30.safetensors",
|
| 28 |
+
"language_model.model.layers.12.self_attn.o_proj.weight": "model-13-of-30.safetensors",
|
| 29 |
+
"language_model.model.layers.12.self_attn.v_proj.weight": "model-13-of-30.safetensors",
|
| 30 |
+
"language_model.model.layers.1.self_attn.k_proj.bias": "model-2-of-30.safetensors",
|
| 31 |
+
"language_model.model.layers.1.self_attn.q_proj.bias": "model-2-of-30.safetensors",
|
| 32 |
+
"language_model.model.layers.1.self_attn.k_proj.weight": "model-2-of-30.safetensors",
|
| 33 |
+
"language_model.model.layers.1.self_attn.q_proj.weight": "model-2-of-30.safetensors",
|
| 34 |
+
"language_model.model.layers.1.mlp.up_proj.weight": "model-2-of-30.safetensors",
|
| 35 |
+
"language_model.model.layers.1.mlp.down_proj.weight": "model-2-of-30.safetensors",
|
| 36 |
+
"language_model.model.layers.1.mlp.gate_proj.weight": "model-2-of-30.safetensors",
|
| 37 |
+
"language_model.model.layers.1.post_attention_layernorm.weight": "model-2-of-30.safetensors",
|
| 38 |
+
"language_model.model.layers.1.input_layernorm.weight": "model-2-of-30.safetensors",
|
| 39 |
+
"language_model.model.layers.1.self_attn.v_proj.bias": "model-2-of-30.safetensors",
|
| 40 |
+
"language_model.model.layers.1.self_attn.o_proj.weight": "model-2-of-30.safetensors",
|
| 41 |
+
"language_model.model.layers.1.self_attn.v_proj.weight": "model-2-of-30.safetensors",
|
| 42 |
+
"language_model.model.layers.26.self_attn.k_proj.bias": "model-27-of-30.safetensors",
|
| 43 |
+
"language_model.model.layers.26.self_attn.q_proj.bias": "model-27-of-30.safetensors",
|
| 44 |
+
"language_model.model.layers.26.self_attn.k_proj.weight": "model-27-of-30.safetensors",
|
| 45 |
+
"language_model.model.layers.26.self_attn.q_proj.weight": "model-27-of-30.safetensors",
|
| 46 |
+
"language_model.model.layers.26.mlp.up_proj.weight": "model-27-of-30.safetensors",
|
| 47 |
+
"language_model.model.layers.26.mlp.down_proj.weight": "model-27-of-30.safetensors",
|
| 48 |
+
"language_model.model.layers.26.mlp.gate_proj.weight": "model-27-of-30.safetensors",
|
| 49 |
+
"language_model.model.layers.26.post_attention_layernorm.weight": "model-27-of-30.safetensors",
|
| 50 |
+
"language_model.model.layers.26.input_layernorm.weight": "model-27-of-30.safetensors",
|
| 51 |
+
"language_model.model.layers.26.self_attn.v_proj.bias": "model-27-of-30.safetensors",
|
| 52 |
+
"language_model.model.layers.26.self_attn.o_proj.weight": "model-27-of-30.safetensors",
|
| 53 |
+
"language_model.model.layers.26.self_attn.v_proj.weight": "model-27-of-30.safetensors",
|
| 54 |
+
"language_model.model.layers.11.self_attn.k_proj.bias": "model-12-of-30.safetensors",
|
| 55 |
+
"language_model.model.layers.11.self_attn.q_proj.bias": "model-12-of-30.safetensors",
|
| 56 |
+
"language_model.model.layers.11.self_attn.k_proj.weight": "model-12-of-30.safetensors",
|
| 57 |
+
"language_model.model.layers.11.self_attn.q_proj.weight": "model-12-of-30.safetensors",
|
| 58 |
+
"language_model.model.layers.11.mlp.up_proj.weight": "model-12-of-30.safetensors",
|
| 59 |
+
"language_model.model.layers.11.mlp.down_proj.weight": "model-12-of-30.safetensors",
|
| 60 |
+
"language_model.model.layers.11.mlp.gate_proj.weight": "model-12-of-30.safetensors",
|
| 61 |
+
"language_model.model.layers.11.post_attention_layernorm.weight": "model-12-of-30.safetensors",
|
| 62 |
+
"language_model.model.layers.11.input_layernorm.weight": "model-12-of-30.safetensors",
|
| 63 |
+
"language_model.model.layers.11.self_attn.v_proj.bias": "model-12-of-30.safetensors",
|
| 64 |
+
"language_model.model.layers.11.self_attn.o_proj.weight": "model-12-of-30.safetensors",
|
| 65 |
+
"language_model.model.layers.11.self_attn.v_proj.weight": "model-12-of-30.safetensors",
|
| 66 |
+
"language_model.model.layers.14.self_attn.k_proj.bias": "model-15-of-30.safetensors",
|
| 67 |
+
"language_model.model.layers.14.self_attn.q_proj.bias": "model-15-of-30.safetensors",
|
| 68 |
+
"language_model.model.layers.14.self_attn.k_proj.weight": "model-15-of-30.safetensors",
|
| 69 |
+
"language_model.model.layers.14.self_attn.q_proj.weight": "model-15-of-30.safetensors",
|
| 70 |
+
"language_model.model.layers.14.mlp.up_proj.weight": "model-15-of-30.safetensors",
|
| 71 |
+
"language_model.model.layers.14.mlp.down_proj.weight": "model-15-of-30.safetensors",
|
| 72 |
+
"language_model.model.layers.14.mlp.gate_proj.weight": "model-15-of-30.safetensors",
|
| 73 |
+
"language_model.model.layers.14.post_attention_layernorm.weight": "model-15-of-30.safetensors",
|
| 74 |
+
"language_model.model.layers.14.input_layernorm.weight": "model-15-of-30.safetensors",
|
| 75 |
+
"language_model.model.layers.14.self_attn.v_proj.bias": "model-15-of-30.safetensors",
|
| 76 |
+
"language_model.model.layers.14.self_attn.o_proj.weight": "model-15-of-30.safetensors",
|
| 77 |
+
"language_model.model.layers.14.self_attn.v_proj.weight": "model-15-of-30.safetensors",
|
| 78 |
+
"language_model.model.layers.23.self_attn.k_proj.bias": "model-24-of-30.safetensors",
|
| 79 |
+
"language_model.model.layers.23.self_attn.q_proj.bias": "model-24-of-30.safetensors",
|
| 80 |
+
"language_model.model.layers.23.self_attn.k_proj.weight": "model-24-of-30.safetensors",
|
| 81 |
+
"language_model.model.layers.23.self_attn.q_proj.weight": "model-24-of-30.safetensors",
|
| 82 |
+
"language_model.model.layers.23.mlp.up_proj.weight": "model-24-of-30.safetensors",
|
| 83 |
+
"language_model.model.layers.23.mlp.down_proj.weight": "model-24-of-30.safetensors",
|
| 84 |
+
"language_model.model.layers.23.mlp.gate_proj.weight": "model-24-of-30.safetensors",
|
| 85 |
+
"language_model.model.layers.23.post_attention_layernorm.weight": "model-24-of-30.safetensors",
|
| 86 |
+
"language_model.model.layers.23.input_layernorm.weight": "model-24-of-30.safetensors",
|
| 87 |
+
"language_model.model.layers.23.self_attn.v_proj.bias": "model-24-of-30.safetensors",
|
| 88 |
+
"language_model.model.layers.23.self_attn.o_proj.weight": "model-24-of-30.safetensors",
|
| 89 |
+
"language_model.model.layers.23.self_attn.v_proj.weight": "model-24-of-30.safetensors",
|
| 90 |
+
"language_model.model.layers.25.self_attn.k_proj.bias": "model-26-of-30.safetensors",
|
| 91 |
+
"language_model.model.layers.25.self_attn.q_proj.bias": "model-26-of-30.safetensors",
|
| 92 |
+
"language_model.model.layers.25.self_attn.k_proj.weight": "model-26-of-30.safetensors",
|
| 93 |
+
"language_model.model.layers.25.self_attn.q_proj.weight": "model-26-of-30.safetensors",
|
| 94 |
+
"language_model.model.layers.25.mlp.up_proj.weight": "model-26-of-30.safetensors",
|
| 95 |
+
"language_model.model.layers.25.mlp.down_proj.weight": "model-26-of-30.safetensors",
|
| 96 |
+
"language_model.model.layers.25.mlp.gate_proj.weight": "model-26-of-30.safetensors",
|
| 97 |
+
"language_model.model.layers.25.post_attention_layernorm.weight": "model-26-of-30.safetensors",
|
| 98 |
+
"language_model.model.layers.25.input_layernorm.weight": "model-26-of-30.safetensors",
|
| 99 |
+
"language_model.model.layers.25.self_attn.v_proj.bias": "model-26-of-30.safetensors",
|
| 100 |
+
"language_model.model.layers.25.self_attn.o_proj.weight": "model-26-of-30.safetensors",
|
| 101 |
+
"language_model.model.layers.25.self_attn.v_proj.weight": "model-26-of-30.safetensors",
|
| 102 |
+
"language_model.model.layers.9.self_attn.k_proj.bias": "model-10-of-30.safetensors",
|
| 103 |
+
"language_model.model.layers.9.self_attn.q_proj.bias": "model-10-of-30.safetensors",
|
| 104 |
+
"language_model.model.layers.9.self_attn.k_proj.weight": "model-10-of-30.safetensors",
|
| 105 |
+
"language_model.model.layers.9.self_attn.q_proj.weight": "model-10-of-30.safetensors",
|
| 106 |
+
"language_model.model.layers.9.mlp.up_proj.weight": "model-10-of-30.safetensors",
|
| 107 |
+
"language_model.model.layers.9.mlp.down_proj.weight": "model-10-of-30.safetensors",
|
| 108 |
+
"language_model.model.layers.9.mlp.gate_proj.weight": "model-10-of-30.safetensors",
|
| 109 |
+
"language_model.model.layers.9.post_attention_layernorm.weight": "model-10-of-30.safetensors",
|
| 110 |
+
"language_model.model.layers.9.input_layernorm.weight": "model-10-of-30.safetensors",
|
| 111 |
+
"language_model.model.layers.9.self_attn.v_proj.bias": "model-10-of-30.safetensors",
|
| 112 |
+
"language_model.model.layers.9.self_attn.o_proj.weight": "model-10-of-30.safetensors",
|
| 113 |
+
"language_model.model.layers.9.self_attn.v_proj.weight": "model-10-of-30.safetensors",
|
| 114 |
+
"language_model.model.layers.20.self_attn.k_proj.bias": "model-21-of-30.safetensors",
|
| 115 |
+
"language_model.model.layers.20.self_attn.q_proj.bias": "model-21-of-30.safetensors",
|
| 116 |
+
"language_model.model.layers.20.self_attn.k_proj.weight": "model-21-of-30.safetensors",
|
| 117 |
+
"language_model.model.layers.20.self_attn.q_proj.weight": "model-21-of-30.safetensors",
|
| 118 |
+
"language_model.model.layers.20.mlp.up_proj.weight": "model-21-of-30.safetensors",
|
| 119 |
+
"language_model.model.layers.20.mlp.down_proj.weight": "model-21-of-30.safetensors",
|
| 120 |
+
"language_model.model.layers.20.mlp.gate_proj.weight": "model-21-of-30.safetensors",
|
| 121 |
+
"language_model.model.layers.20.post_attention_layernorm.weight": "model-21-of-30.safetensors",
|
| 122 |
+
"language_model.model.layers.20.input_layernorm.weight": "model-21-of-30.safetensors",
|
| 123 |
+
"language_model.model.layers.20.self_attn.v_proj.bias": "model-21-of-30.safetensors",
|
| 124 |
+
"language_model.model.layers.20.self_attn.o_proj.weight": "model-21-of-30.safetensors",
|
| 125 |
+
"language_model.model.layers.20.self_attn.v_proj.weight": "model-21-of-30.safetensors",
|
| 126 |
+
"language_model.model.layers.21.self_attn.k_proj.bias": "model-22-of-30.safetensors",
|
| 127 |
+
"language_model.model.layers.21.self_attn.q_proj.bias": "model-22-of-30.safetensors",
|
| 128 |
+
"language_model.model.layers.21.self_attn.k_proj.weight": "model-22-of-30.safetensors",
|
| 129 |
+
"language_model.model.layers.21.self_attn.q_proj.weight": "model-22-of-30.safetensors",
|
| 130 |
+
"language_model.model.layers.21.mlp.up_proj.weight": "model-22-of-30.safetensors",
|
| 131 |
+
"language_model.model.layers.21.mlp.down_proj.weight": "model-22-of-30.safetensors",
|
| 132 |
+
"language_model.model.layers.21.mlp.gate_proj.weight": "model-22-of-30.safetensors",
|
| 133 |
+
"language_model.model.layers.21.post_attention_layernorm.weight": "model-22-of-30.safetensors",
|
| 134 |
+
"language_model.model.layers.21.input_layernorm.weight": "model-22-of-30.safetensors",
|
| 135 |
+
"language_model.model.layers.21.self_attn.v_proj.bias": "model-22-of-30.safetensors",
|
| 136 |
+
"language_model.model.layers.21.self_attn.o_proj.weight": "model-22-of-30.safetensors",
|
| 137 |
+
"language_model.model.layers.21.self_attn.v_proj.weight": "model-22-of-30.safetensors",
|
| 138 |
+
"language_model.model.layers.27.self_attn.k_proj.bias": "model-28-of-30.safetensors",
|
| 139 |
+
"language_model.model.layers.27.self_attn.q_proj.bias": "model-28-of-30.safetensors",
|
| 140 |
+
"language_model.model.layers.27.self_attn.k_proj.weight": "model-28-of-30.safetensors",
|
| 141 |
+
"language_model.model.layers.27.self_attn.q_proj.weight": "model-28-of-30.safetensors",
|
| 142 |
+
"language_model.model.layers.27.mlp.up_proj.weight": "model-28-of-30.safetensors",
|
| 143 |
+
"language_model.model.layers.27.mlp.down_proj.weight": "model-28-of-30.safetensors",
|
| 144 |
+
"language_model.model.layers.27.mlp.gate_proj.weight": "model-28-of-30.safetensors",
|
| 145 |
+
"language_model.model.layers.27.post_attention_layernorm.weight": "model-28-of-30.safetensors",
|
| 146 |
+
"language_model.model.layers.27.input_layernorm.weight": "model-28-of-30.safetensors",
|
| 147 |
+
"language_model.model.layers.27.self_attn.v_proj.bias": "model-28-of-30.safetensors",
|
| 148 |
+
"language_model.model.layers.27.self_attn.o_proj.weight": "model-28-of-30.safetensors",
|
| 149 |
+
"language_model.model.layers.27.self_attn.v_proj.weight": "model-28-of-30.safetensors",
|
| 150 |
+
"language_model.model.layers.18.self_attn.k_proj.bias": "model-19-of-30.safetensors",
|
| 151 |
+
"language_model.model.layers.18.self_attn.q_proj.bias": "model-19-of-30.safetensors",
|
| 152 |
+
"language_model.model.layers.18.self_attn.k_proj.weight": "model-19-of-30.safetensors",
|
| 153 |
+
"language_model.model.layers.18.self_attn.q_proj.weight": "model-19-of-30.safetensors",
|
| 154 |
+
"language_model.model.layers.18.mlp.up_proj.weight": "model-19-of-30.safetensors",
|
| 155 |
+
"language_model.model.layers.18.mlp.down_proj.weight": "model-19-of-30.safetensors",
|
| 156 |
+
"language_model.model.layers.18.mlp.gate_proj.weight": "model-19-of-30.safetensors",
|
| 157 |
+
"language_model.model.layers.18.post_attention_layernorm.weight": "model-19-of-30.safetensors",
|
| 158 |
+
"language_model.model.layers.18.input_layernorm.weight": "model-19-of-30.safetensors",
|
| 159 |
+
"language_model.model.layers.18.self_attn.v_proj.bias": "model-19-of-30.safetensors",
|
| 160 |
+
"language_model.model.layers.18.self_attn.o_proj.weight": "model-19-of-30.safetensors",
|
| 161 |
+
"language_model.model.layers.18.self_attn.v_proj.weight": "model-19-of-30.safetensors",
|
| 162 |
+
"language_model.model.layers.0.self_attn.k_proj.bias": "model-1-of-30.safetensors",
|
| 163 |
+
"language_model.model.layers.0.self_attn.q_proj.bias": "model-1-of-30.safetensors",
|
| 164 |
+
"language_model.model.layers.0.self_attn.k_proj.weight": "model-1-of-30.safetensors",
|
| 165 |
+
"language_model.model.layers.0.self_attn.q_proj.weight": "model-1-of-30.safetensors",
|
| 166 |
+
"language_model.model.layers.0.mlp.up_proj.weight": "model-1-of-30.safetensors",
|
| 167 |
+
"language_model.model.layers.0.mlp.down_proj.weight": "model-1-of-30.safetensors",
|
| 168 |
+
"language_model.model.layers.0.mlp.gate_proj.weight": "model-1-of-30.safetensors",
|
| 169 |
+
"language_model.model.layers.0.post_attention_layernorm.weight": "model-1-of-30.safetensors",
|
| 170 |
+
"language_model.model.layers.0.input_layernorm.weight": "model-1-of-30.safetensors",
|
| 171 |
+
"language_model.model.layers.0.self_attn.v_proj.bias": "model-1-of-30.safetensors",
|
| 172 |
+
"language_model.model.layers.0.self_attn.o_proj.weight": "model-1-of-30.safetensors",
|
| 173 |
+
"language_model.model.layers.0.self_attn.v_proj.weight": "model-1-of-30.safetensors",
|
| 174 |
+
"language_model.model.layers.5.self_attn.k_proj.bias": "model-6-of-30.safetensors",
|
| 175 |
+
"language_model.model.layers.5.self_attn.q_proj.bias": "model-6-of-30.safetensors",
|
| 176 |
+
"language_model.model.layers.5.self_attn.k_proj.weight": "model-6-of-30.safetensors",
|
| 177 |
+
"language_model.model.layers.5.self_attn.q_proj.weight": "model-6-of-30.safetensors",
|
| 178 |
+
"language_model.model.layers.5.mlp.up_proj.weight": "model-6-of-30.safetensors",
|
| 179 |
+
"language_model.model.layers.5.mlp.down_proj.weight": "model-6-of-30.safetensors",
|
| 180 |
+
"language_model.model.layers.5.mlp.gate_proj.weight": "model-6-of-30.safetensors",
|
| 181 |
+
"language_model.model.layers.5.post_attention_layernorm.weight": "model-6-of-30.safetensors",
|
| 182 |
+
"language_model.model.layers.5.input_layernorm.weight": "model-6-of-30.safetensors",
|
| 183 |
+
"language_model.model.layers.5.self_attn.v_proj.bias": "model-6-of-30.safetensors",
|
| 184 |
+
"language_model.model.layers.5.self_attn.o_proj.weight": "model-6-of-30.safetensors",
|
| 185 |
+
"language_model.model.layers.5.self_attn.v_proj.weight": "model-6-of-30.safetensors",
|
| 186 |
+
"language_model.model.layers.6.self_attn.k_proj.bias": "model-7-of-30.safetensors",
|
| 187 |
+
"language_model.model.layers.6.self_attn.q_proj.bias": "model-7-of-30.safetensors",
|
| 188 |
+
"language_model.model.layers.6.self_attn.k_proj.weight": "model-7-of-30.safetensors",
|
| 189 |
+
"language_model.model.layers.6.self_attn.q_proj.weight": "model-7-of-30.safetensors",
|
| 190 |
+
"language_model.model.layers.6.mlp.up_proj.weight": "model-7-of-30.safetensors",
|
| 191 |
+
"language_model.model.layers.6.mlp.down_proj.weight": "model-7-of-30.safetensors",
|
| 192 |
+
"language_model.model.layers.6.mlp.gate_proj.weight": "model-7-of-30.safetensors",
|
| 193 |
+
"language_model.model.layers.6.post_attention_layernorm.weight": "model-7-of-30.safetensors",
|
| 194 |
+
"language_model.model.layers.6.input_layernorm.weight": "model-7-of-30.safetensors",
|
| 195 |
+
"language_model.model.layers.6.self_attn.v_proj.bias": "model-7-of-30.safetensors",
|
| 196 |
+
"language_model.model.layers.6.self_attn.o_proj.weight": "model-7-of-30.safetensors",
|
| 197 |
+
"language_model.model.layers.6.self_attn.v_proj.weight": "model-7-of-30.safetensors",
|
| 198 |
+
"language_model.model.layers.4.self_attn.k_proj.bias": "model-5-of-30.safetensors",
|
| 199 |
+
"language_model.model.layers.4.self_attn.q_proj.bias": "model-5-of-30.safetensors",
|
| 200 |
+
"language_model.model.layers.4.self_attn.k_proj.weight": "model-5-of-30.safetensors",
|
| 201 |
+
"language_model.model.layers.4.self_attn.q_proj.weight": "model-5-of-30.safetensors",
|
| 202 |
+
"language_model.model.layers.4.mlp.up_proj.weight": "model-5-of-30.safetensors",
|
| 203 |
+
"language_model.model.layers.4.mlp.down_proj.weight": "model-5-of-30.safetensors",
|
| 204 |
+
"language_model.model.layers.4.mlp.gate_proj.weight": "model-5-of-30.safetensors",
|
| 205 |
+
"language_model.model.layers.4.post_attention_layernorm.weight": "model-5-of-30.safetensors",
|
| 206 |
+
"language_model.model.layers.4.input_layernorm.weight": "model-5-of-30.safetensors",
|
| 207 |
+
"language_model.model.layers.4.self_attn.v_proj.bias": "model-5-of-30.safetensors",
|
| 208 |
+
"language_model.model.layers.4.self_attn.o_proj.weight": "model-5-of-30.safetensors",
|
| 209 |
+
"language_model.model.layers.4.self_attn.v_proj.weight": "model-5-of-30.safetensors",
|
| 210 |
+
"language_model.model.layers.15.self_attn.k_proj.bias": "model-16-of-30.safetensors",
|
| 211 |
+
"language_model.model.layers.15.self_attn.q_proj.bias": "model-16-of-30.safetensors",
|
| 212 |
+
"language_model.model.layers.15.self_attn.k_proj.weight": "model-16-of-30.safetensors",
|
| 213 |
+
"language_model.model.layers.15.self_attn.q_proj.weight": "model-16-of-30.safetensors",
|
| 214 |
+
"language_model.model.layers.15.mlp.up_proj.weight": "model-16-of-30.safetensors",
|
| 215 |
+
"language_model.model.layers.15.mlp.down_proj.weight": "model-16-of-30.safetensors",
|
| 216 |
+
"language_model.model.layers.15.mlp.gate_proj.weight": "model-16-of-30.safetensors",
|
| 217 |
+
"language_model.model.layers.15.post_attention_layernorm.weight": "model-16-of-30.safetensors",
|
| 218 |
+
"language_model.model.layers.15.input_layernorm.weight": "model-16-of-30.safetensors",
|
| 219 |
+
"language_model.model.layers.15.self_attn.v_proj.bias": "model-16-of-30.safetensors",
|
| 220 |
+
"language_model.model.layers.15.self_attn.o_proj.weight": "model-16-of-30.safetensors",
|
| 221 |
+
"language_model.model.layers.15.self_attn.v_proj.weight": "model-16-of-30.safetensors",
|
| 222 |
+
"language_model.model.layers.22.self_attn.k_proj.bias": "model-23-of-30.safetensors",
|
| 223 |
+
"language_model.model.layers.22.self_attn.q_proj.bias": "model-23-of-30.safetensors",
|
| 224 |
+
"language_model.model.layers.22.self_attn.k_proj.weight": "model-23-of-30.safetensors",
|
| 225 |
+
"language_model.model.layers.22.self_attn.q_proj.weight": "model-23-of-30.safetensors",
|
| 226 |
+
"language_model.model.layers.22.mlp.up_proj.weight": "model-23-of-30.safetensors",
|
| 227 |
+
"language_model.model.layers.22.mlp.down_proj.weight": "model-23-of-30.safetensors",
|
| 228 |
+
"language_model.model.layers.22.mlp.gate_proj.weight": "model-23-of-30.safetensors",
|
| 229 |
+
"language_model.model.layers.22.post_attention_layernorm.weight": "model-23-of-30.safetensors",
|
| 230 |
+
"language_model.model.layers.22.input_layernorm.weight": "model-23-of-30.safetensors",
|
| 231 |
+
"language_model.model.layers.22.self_attn.v_proj.bias": "model-23-of-30.safetensors",
|
| 232 |
+
"language_model.model.layers.22.self_attn.o_proj.weight": "model-23-of-30.safetensors",
|
| 233 |
+
"language_model.model.layers.22.self_attn.v_proj.weight": "model-23-of-30.safetensors",
|
| 234 |
+
"language_model.lm_head.weight": "model-29-of-30.safetensors",
|
| 235 |
+
"language_model.model.norm.weight": "model-29-of-30.safetensors",
|
| 236 |
+
"language_model.model.embed_tokens.weight": "model-29-of-30.safetensors",
|
| 237 |
+
"language_model.model.layers.7.self_attn.k_proj.bias": "model-8-of-30.safetensors",
|
| 238 |
+
"language_model.model.layers.7.self_attn.q_proj.bias": "model-8-of-30.safetensors",
|
| 239 |
+
"language_model.model.layers.7.self_attn.k_proj.weight": "model-8-of-30.safetensors",
|
| 240 |
+
"language_model.model.layers.7.self_attn.q_proj.weight": "model-8-of-30.safetensors",
|
| 241 |
+
"language_model.model.layers.7.mlp.up_proj.weight": "model-8-of-30.safetensors",
|
| 242 |
+
"language_model.model.layers.7.mlp.down_proj.weight": "model-8-of-30.safetensors",
|
| 243 |
+
"language_model.model.layers.7.mlp.gate_proj.weight": "model-8-of-30.safetensors",
|
| 244 |
+
"language_model.model.layers.7.post_attention_layernorm.weight": "model-8-of-30.safetensors",
|
| 245 |
+
"language_model.model.layers.7.input_layernorm.weight": "model-8-of-30.safetensors",
|
| 246 |
+
"language_model.model.layers.7.self_attn.v_proj.bias": "model-8-of-30.safetensors",
|
| 247 |
+
"language_model.model.layers.7.self_attn.o_proj.weight": "model-8-of-30.safetensors",
|
| 248 |
+
"language_model.model.layers.7.self_attn.v_proj.weight": "model-8-of-30.safetensors",
|
| 249 |
+
"language_model.model.layers.16.self_attn.k_proj.bias": "model-17-of-30.safetensors",
|
| 250 |
+
"language_model.model.layers.16.self_attn.q_proj.bias": "model-17-of-30.safetensors",
|
| 251 |
+
"language_model.model.layers.16.self_attn.k_proj.weight": "model-17-of-30.safetensors",
|
| 252 |
+
"language_model.model.layers.16.self_attn.q_proj.weight": "model-17-of-30.safetensors",
|
| 253 |
+
"language_model.model.layers.16.mlp.up_proj.weight": "model-17-of-30.safetensors",
|
| 254 |
+
"language_model.model.layers.16.mlp.down_proj.weight": "model-17-of-30.safetensors",
|
| 255 |
+
"language_model.model.layers.16.mlp.gate_proj.weight": "model-17-of-30.safetensors",
|
| 256 |
+
"language_model.model.layers.16.post_attention_layernorm.weight": "model-17-of-30.safetensors",
|
| 257 |
+
"language_model.model.layers.16.input_layernorm.weight": "model-17-of-30.safetensors",
|
| 258 |
+
"language_model.model.layers.16.self_attn.v_proj.bias": "model-17-of-30.safetensors",
|
| 259 |
+
"language_model.model.layers.16.self_attn.o_proj.weight": "model-17-of-30.safetensors",
|
| 260 |
+
"language_model.model.layers.16.self_attn.v_proj.weight": "model-17-of-30.safetensors",
|
| 261 |
+
"language_model.model.layers.8.self_attn.k_proj.bias": "model-9-of-30.safetensors",
|
| 262 |
+
"language_model.model.layers.8.self_attn.q_proj.bias": "model-9-of-30.safetensors",
|
| 263 |
+
"language_model.model.layers.8.self_attn.k_proj.weight": "model-9-of-30.safetensors",
|
| 264 |
+
"language_model.model.layers.8.self_attn.q_proj.weight": "model-9-of-30.safetensors",
|
| 265 |
+
"language_model.model.layers.8.mlp.up_proj.weight": "model-9-of-30.safetensors",
|
| 266 |
+
"language_model.model.layers.8.mlp.down_proj.weight": "model-9-of-30.safetensors",
|
| 267 |
+
"language_model.model.layers.8.mlp.gate_proj.weight": "model-9-of-30.safetensors",
|
| 268 |
+
"language_model.model.layers.8.post_attention_layernorm.weight": "model-9-of-30.safetensors",
|
| 269 |
+
"language_model.model.layers.8.input_layernorm.weight": "model-9-of-30.safetensors",
|
| 270 |
+
"language_model.model.layers.8.self_attn.v_proj.bias": "model-9-of-30.safetensors",
|
| 271 |
+
"language_model.model.layers.8.self_attn.o_proj.weight": "model-9-of-30.safetensors",
|
| 272 |
+
"language_model.model.layers.8.self_attn.v_proj.weight": "model-9-of-30.safetensors",
|
| 273 |
+
"language_model.model.layers.24.self_attn.k_proj.bias": "model-25-of-30.safetensors",
|
| 274 |
+
"language_model.model.layers.24.self_attn.q_proj.bias": "model-25-of-30.safetensors",
|
| 275 |
+
"language_model.model.layers.24.self_attn.k_proj.weight": "model-25-of-30.safetensors",
|
| 276 |
+
"language_model.model.layers.24.self_attn.q_proj.weight": "model-25-of-30.safetensors",
|
| 277 |
+
"language_model.model.layers.24.mlp.up_proj.weight": "model-25-of-30.safetensors",
|
| 278 |
+
"language_model.model.layers.24.mlp.down_proj.weight": "model-25-of-30.safetensors",
|
| 279 |
+
"language_model.model.layers.24.mlp.gate_proj.weight": "model-25-of-30.safetensors",
|
| 280 |
+
"language_model.model.layers.24.post_attention_layernorm.weight": "model-25-of-30.safetensors",
|
| 281 |
+
"language_model.model.layers.24.input_layernorm.weight": "model-25-of-30.safetensors",
|
| 282 |
+
"language_model.model.layers.24.self_attn.v_proj.bias": "model-25-of-30.safetensors",
|
| 283 |
+
"language_model.model.layers.24.self_attn.o_proj.weight": "model-25-of-30.safetensors",
|
| 284 |
+
"language_model.model.layers.24.self_attn.v_proj.weight": "model-25-of-30.safetensors",
|
| 285 |
+
"vision_tower.blocks.0.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 286 |
+
"vision_tower.blocks.9.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 287 |
+
"vision_tower.blocks.8.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 288 |
+
"vision_tower.blocks.7.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 289 |
+
"vision_tower.blocks.6.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 290 |
+
"vision_tower.blocks.5.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 291 |
+
"vision_tower.blocks.4.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 292 |
+
"vision_tower.blocks.31.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 293 |
+
"vision_tower.blocks.30.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 294 |
+
"vision_tower.blocks.3.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 295 |
+
"vision_tower.blocks.29.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 296 |
+
"vision_tower.blocks.28.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 297 |
+
"vision_tower.blocks.27.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 298 |
+
"vision_tower.blocks.26.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 299 |
+
"vision_tower.blocks.25.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 300 |
+
"vision_tower.blocks.24.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 301 |
+
"vision_tower.blocks.23.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 302 |
+
"vision_tower.blocks.22.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 303 |
+
"vision_tower.blocks.21.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 304 |
+
"vision_tower.blocks.20.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 305 |
+
"vision_tower.blocks.2.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 306 |
+
"vision_tower.blocks.19.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 307 |
+
"vision_tower.blocks.18.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 308 |
+
"vision_tower.blocks.17.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 309 |
+
"vision_tower.blocks.16.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 310 |
+
"vision_tower.blocks.15.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 311 |
+
"vision_tower.blocks.14.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 312 |
+
"vision_tower.blocks.13.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 313 |
+
"vision_tower.blocks.12.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 314 |
+
"vision_tower.blocks.11.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 315 |
+
"vision_tower.blocks.10.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 316 |
+
"vision_tower.blocks.1.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 317 |
+
"vision_tower.blocks.7.attn.proj.weight": "model-30-of-30.safetensors",
|
| 318 |
+
"vision_tower.blocks.4.attn.proj.weight": "model-30-of-30.safetensors",
|
| 319 |
+
"vision_tower.blocks.31.attn.proj.weight": "model-30-of-30.safetensors",
|
| 320 |
+
"vision_tower.blocks.28.attn.proj.weight": "model-30-of-30.safetensors",
|
| 321 |
+
"vision_tower.blocks.25.attn.proj.weight": "model-30-of-30.safetensors",
|
| 322 |
+
"vision_tower.blocks.22.attn.proj.weight": "model-30-of-30.safetensors",
|
| 323 |
+
"vision_tower.blocks.19.attn.proj.weight": "model-30-of-30.safetensors",
|
| 324 |
+
"vision_tower.blocks.16.attn.proj.weight": "model-30-of-30.safetensors",
|
| 325 |
+
"vision_tower.blocks.13.attn.proj.weight": "model-30-of-30.safetensors",
|
| 326 |
+
"vision_tower.blocks.10.attn.proj.weight": "model-30-of-30.safetensors",
|
| 327 |
+
"vision_tower.blocks.1.attn.proj.weight": "model-30-of-30.safetensors",
|
| 328 |
+
"vision_tower.blocks.7.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 329 |
+
"vision_tower.blocks.4.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 330 |
+
"vision_tower.blocks.31.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 331 |
+
"vision_tower.blocks.28.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 332 |
+
"vision_tower.blocks.25.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 333 |
+
"vision_tower.blocks.22.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 334 |
+
"vision_tower.blocks.19.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 335 |
+
"vision_tower.blocks.16.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 336 |
+
"vision_tower.blocks.13.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 337 |
+
"vision_tower.blocks.10.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 338 |
+
"vision_tower.blocks.1.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 339 |
+
"vision_tower.blocks.8.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 340 |
+
"vision_tower.blocks.7.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 341 |
+
"vision_tower.blocks.5.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 342 |
+
"vision_tower.blocks.4.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 343 |
+
"vision_tower.blocks.31.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 344 |
+
"vision_tower.blocks.29.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 345 |
+
"vision_tower.blocks.28.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 346 |
+
"vision_tower.blocks.26.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 347 |
+
"vision_tower.blocks.25.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 348 |
+
"vision_tower.blocks.23.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 349 |
+
"vision_tower.blocks.22.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 350 |
+
"vision_tower.blocks.20.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 351 |
+
"vision_tower.blocks.2.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 352 |
+
"vision_tower.blocks.19.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 353 |
+
"vision_tower.blocks.17.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 354 |
+
"vision_tower.blocks.16.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 355 |
+
"vision_tower.blocks.14.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 356 |
+
"vision_tower.blocks.13.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 357 |
+
"vision_tower.blocks.11.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 358 |
+
"vision_tower.blocks.10.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 359 |
+
"vision_tower.blocks.1.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 360 |
+
"vision_tower.blocks.9.attn.proj.bias": "model-30-of-30.safetensors",
|
| 361 |
+
"vision_tower.blocks.6.attn.proj.bias": "model-30-of-30.safetensors",
|
| 362 |
+
"vision_tower.blocks.30.attn.proj.bias": "model-30-of-30.safetensors",
|
| 363 |
+
"vision_tower.blocks.3.attn.proj.bias": "model-30-of-30.safetensors",
|
| 364 |
+
"vision_tower.blocks.27.attn.proj.bias": "model-30-of-30.safetensors",
|
| 365 |
+
"vision_tower.blocks.24.attn.proj.bias": "model-30-of-30.safetensors",
|
| 366 |
+
"vision_tower.blocks.21.attn.proj.bias": "model-30-of-30.safetensors",
|
| 367 |
+
"vision_tower.blocks.18.attn.proj.bias": "model-30-of-30.safetensors",
|
| 368 |
+
"vision_tower.blocks.15.attn.proj.bias": "model-30-of-30.safetensors",
|
| 369 |
+
"vision_tower.blocks.12.attn.proj.bias": "model-30-of-30.safetensors",
|
| 370 |
+
"vision_tower.blocks.9.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 371 |
+
"vision_tower.blocks.8.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 372 |
+
"vision_tower.blocks.7.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 373 |
+
"vision_tower.blocks.6.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 374 |
+
"vision_tower.blocks.5.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 375 |
+
"vision_tower.blocks.4.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 376 |
+
"vision_tower.blocks.31.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 377 |
+
"vision_tower.blocks.30.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 378 |
+
"vision_tower.blocks.3.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 379 |
+
"vision_tower.blocks.29.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 380 |
+
"vision_tower.blocks.28.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 381 |
+
"vision_tower.blocks.27.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 382 |
+
"vision_tower.blocks.26.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 383 |
+
"vision_tower.blocks.25.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 384 |
+
"vision_tower.blocks.24.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 385 |
+
"vision_tower.blocks.23.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 386 |
+
"vision_tower.blocks.22.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 387 |
+
"vision_tower.blocks.21.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 388 |
+
"vision_tower.blocks.20.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 389 |
+
"vision_tower.blocks.2.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 390 |
+
"vision_tower.blocks.19.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 391 |
+
"vision_tower.blocks.18.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 392 |
+
"vision_tower.blocks.17.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 393 |
+
"vision_tower.blocks.16.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 394 |
+
"vision_tower.blocks.15.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 395 |
+
"vision_tower.blocks.14.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 396 |
+
"vision_tower.blocks.13.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 397 |
+
"vision_tower.blocks.12.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 398 |
+
"vision_tower.blocks.11.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 399 |
+
"vision_tower.blocks.10.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 400 |
+
"vision_tower.blocks.1.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 401 |
+
"vision_tower.blocks.0.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 402 |
+
"vision_tower.blocks.9.attn.proj.weight": "model-30-of-30.safetensors",
|
| 403 |
+
"vision_tower.blocks.6.attn.proj.weight": "model-30-of-30.safetensors",
|
| 404 |
+
"vision_tower.blocks.30.attn.proj.weight": "model-30-of-30.safetensors",
|
| 405 |
+
"vision_tower.blocks.3.attn.proj.weight": "model-30-of-30.safetensors",
|
| 406 |
+
"vision_tower.blocks.27.attn.proj.weight": "model-30-of-30.safetensors",
|
| 407 |
+
"vision_tower.blocks.24.attn.proj.weight": "model-30-of-30.safetensors",
|
| 408 |
+
"vision_tower.blocks.21.attn.proj.weight": "model-30-of-30.safetensors",
|
| 409 |
+
"vision_tower.blocks.18.attn.proj.weight": "model-30-of-30.safetensors",
|
| 410 |
+
"vision_tower.blocks.15.attn.proj.weight": "model-30-of-30.safetensors",
|
| 411 |
+
"vision_tower.blocks.12.attn.proj.weight": "model-30-of-30.safetensors",
|
| 412 |
+
"vision_tower.blocks.0.attn.proj.weight": "model-30-of-30.safetensors",
|
| 413 |
+
"vision_tower.blocks.9.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 414 |
+
"vision_tower.blocks.6.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 415 |
+
"vision_tower.blocks.30.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 416 |
+
"vision_tower.blocks.3.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 417 |
+
"vision_tower.blocks.27.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 418 |
+
"vision_tower.blocks.24.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 419 |
+
"vision_tower.blocks.21.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 420 |
+
"vision_tower.blocks.18.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 421 |
+
"vision_tower.blocks.15.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 422 |
+
"vision_tower.blocks.12.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 423 |
+
"vision_tower.merger.mlp.2.bias": "model-30-of-30.safetensors",
|
| 424 |
+
"vision_tower.blocks.9.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 425 |
+
"vision_tower.blocks.7.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 426 |
+
"vision_tower.blocks.6.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 427 |
+
"vision_tower.blocks.4.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 428 |
+
"vision_tower.blocks.31.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 429 |
+
"vision_tower.blocks.30.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 430 |
+
"vision_tower.blocks.3.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 431 |
+
"vision_tower.blocks.28.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 432 |
+
"vision_tower.blocks.27.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 433 |
+
"vision_tower.blocks.25.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 434 |
+
"vision_tower.blocks.24.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 435 |
+
"vision_tower.blocks.22.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 436 |
+
"vision_tower.blocks.21.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 437 |
+
"vision_tower.blocks.19.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 438 |
+
"vision_tower.blocks.18.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 439 |
+
"vision_tower.blocks.16.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 440 |
+
"vision_tower.blocks.15.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 441 |
+
"vision_tower.blocks.13.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 442 |
+
"vision_tower.blocks.12.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 443 |
+
"vision_tower.blocks.10.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 444 |
+
"vision_tower.blocks.1.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 445 |
+
"vision_tower.blocks.0.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 446 |
+
"vision_tower.blocks.8.attn.proj.bias": "model-30-of-30.safetensors",
|
| 447 |
+
"vision_tower.blocks.5.attn.proj.bias": "model-30-of-30.safetensors",
|
| 448 |
+
"vision_tower.blocks.29.attn.proj.bias": "model-30-of-30.safetensors",
|
| 449 |
+
"vision_tower.blocks.26.attn.proj.bias": "model-30-of-30.safetensors",
|
| 450 |
+
"vision_tower.blocks.23.attn.proj.bias": "model-30-of-30.safetensors",
|
| 451 |
+
"vision_tower.blocks.20.attn.proj.bias": "model-30-of-30.safetensors",
|
| 452 |
+
"vision_tower.blocks.2.attn.proj.bias": "model-30-of-30.safetensors",
|
| 453 |
+
"vision_tower.blocks.17.attn.proj.bias": "model-30-of-30.safetensors",
|
| 454 |
+
"vision_tower.blocks.14.attn.proj.bias": "model-30-of-30.safetensors",
|
| 455 |
+
"vision_tower.blocks.11.attn.proj.bias": "model-30-of-30.safetensors",
|
| 456 |
+
"vision_tower.blocks.0.norm2.weight": "model-30-of-30.safetensors",
|
| 457 |
+
"vision_tower.merger.mlp.0.weight": "model-30-of-30.safetensors",
|
| 458 |
+
"vision_tower.blocks.9.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 459 |
+
"vision_tower.blocks.8.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 460 |
+
"vision_tower.blocks.7.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 461 |
+
"vision_tower.blocks.6.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 462 |
+
"vision_tower.blocks.5.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 463 |
+
"vision_tower.blocks.4.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 464 |
+
"vision_tower.blocks.31.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 465 |
+
"vision_tower.blocks.30.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 466 |
+
"vision_tower.blocks.3.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 467 |
+
"vision_tower.blocks.29.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 468 |
+
"vision_tower.blocks.28.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 469 |
+
"vision_tower.blocks.27.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 470 |
+
"vision_tower.blocks.26.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 471 |
+
"vision_tower.blocks.25.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 472 |
+
"vision_tower.blocks.24.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 473 |
+
"vision_tower.blocks.23.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 474 |
+
"vision_tower.blocks.22.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 475 |
+
"vision_tower.blocks.21.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 476 |
+
"vision_tower.blocks.20.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 477 |
+
"vision_tower.blocks.2.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 478 |
+
"vision_tower.blocks.19.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 479 |
+
"vision_tower.blocks.18.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 480 |
+
"vision_tower.blocks.17.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 481 |
+
"vision_tower.blocks.16.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 482 |
+
"vision_tower.blocks.15.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 483 |
+
"vision_tower.blocks.14.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 484 |
+
"vision_tower.blocks.13.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 485 |
+
"vision_tower.blocks.12.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 486 |
+
"vision_tower.blocks.11.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 487 |
+
"vision_tower.blocks.10.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 488 |
+
"vision_tower.blocks.1.attn.qkv.weight": "model-30-of-30.safetensors",
|
| 489 |
+
"vision_tower.blocks.0.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 490 |
+
"vision_tower.blocks.0.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 491 |
+
"vision_tower.merger.ln_q.weight": "model-30-of-30.safetensors",
|
| 492 |
+
"vision_tower.blocks.9.norm2.weight": "model-30-of-30.safetensors",
|
| 493 |
+
"vision_tower.blocks.9.norm1.weight": "model-30-of-30.safetensors",
|
| 494 |
+
"vision_tower.blocks.9.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 495 |
+
"vision_tower.blocks.8.norm2.weight": "model-30-of-30.safetensors",
|
| 496 |
+
"vision_tower.blocks.8.norm1.weight": "model-30-of-30.safetensors",
|
| 497 |
+
"vision_tower.blocks.8.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 498 |
+
"vision_tower.blocks.7.norm2.weight": "model-30-of-30.safetensors",
|
| 499 |
+
"vision_tower.blocks.7.norm1.weight": "model-30-of-30.safetensors",
|
| 500 |
+
"vision_tower.blocks.7.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 501 |
+
"vision_tower.blocks.6.norm2.weight": "model-30-of-30.safetensors",
|
| 502 |
+
"vision_tower.blocks.6.norm1.weight": "model-30-of-30.safetensors",
|
| 503 |
+
"vision_tower.blocks.6.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 504 |
+
"vision_tower.blocks.5.norm2.weight": "model-30-of-30.safetensors",
|
| 505 |
+
"vision_tower.blocks.5.norm1.weight": "model-30-of-30.safetensors",
|
| 506 |
+
"vision_tower.blocks.5.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 507 |
+
"vision_tower.blocks.4.norm2.weight": "model-30-of-30.safetensors",
|
| 508 |
+
"vision_tower.blocks.4.norm1.weight": "model-30-of-30.safetensors",
|
| 509 |
+
"vision_tower.blocks.4.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 510 |
+
"vision_tower.blocks.31.norm2.weight": "model-30-of-30.safetensors",
|
| 511 |
+
"vision_tower.blocks.31.norm1.weight": "model-30-of-30.safetensors",
|
| 512 |
+
"vision_tower.blocks.31.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 513 |
+
"vision_tower.blocks.30.norm2.weight": "model-30-of-30.safetensors",
|
| 514 |
+
"vision_tower.blocks.30.norm1.weight": "model-30-of-30.safetensors",
|
| 515 |
+
"vision_tower.blocks.30.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 516 |
+
"vision_tower.blocks.3.norm2.weight": "model-30-of-30.safetensors",
|
| 517 |
+
"vision_tower.blocks.3.norm1.weight": "model-30-of-30.safetensors",
|
| 518 |
+
"vision_tower.blocks.3.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 519 |
+
"vision_tower.blocks.29.norm2.weight": "model-30-of-30.safetensors",
|
| 520 |
+
"vision_tower.blocks.29.norm1.weight": "model-30-of-30.safetensors",
|
| 521 |
+
"vision_tower.blocks.29.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 522 |
+
"vision_tower.blocks.28.norm2.weight": "model-30-of-30.safetensors",
|
| 523 |
+
"vision_tower.blocks.28.norm1.weight": "model-30-of-30.safetensors",
|
| 524 |
+
"vision_tower.blocks.28.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 525 |
+
"vision_tower.blocks.27.norm2.weight": "model-30-of-30.safetensors",
|
| 526 |
+
"vision_tower.blocks.27.norm1.weight": "model-30-of-30.safetensors",
|
| 527 |
+
"vision_tower.blocks.27.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 528 |
+
"vision_tower.blocks.26.norm2.weight": "model-30-of-30.safetensors",
|
| 529 |
+
"vision_tower.blocks.26.norm1.weight": "model-30-of-30.safetensors",
|
| 530 |
+
"vision_tower.blocks.26.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 531 |
+
"vision_tower.blocks.25.norm2.weight": "model-30-of-30.safetensors",
|
| 532 |
+
"vision_tower.blocks.25.norm1.weight": "model-30-of-30.safetensors",
|
| 533 |
+
"vision_tower.blocks.25.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 534 |
+
"vision_tower.blocks.24.norm2.weight": "model-30-of-30.safetensors",
|
| 535 |
+
"vision_tower.blocks.24.norm1.weight": "model-30-of-30.safetensors",
|
| 536 |
+
"vision_tower.blocks.24.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 537 |
+
"vision_tower.blocks.23.norm2.weight": "model-30-of-30.safetensors",
|
| 538 |
+
"vision_tower.blocks.23.norm1.weight": "model-30-of-30.safetensors",
|
| 539 |
+
"vision_tower.blocks.23.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 540 |
+
"vision_tower.blocks.22.norm2.weight": "model-30-of-30.safetensors",
|
| 541 |
+
"vision_tower.blocks.22.norm1.weight": "model-30-of-30.safetensors",
|
| 542 |
+
"vision_tower.blocks.22.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 543 |
+
"vision_tower.blocks.21.norm2.weight": "model-30-of-30.safetensors",
|
| 544 |
+
"vision_tower.blocks.21.norm1.weight": "model-30-of-30.safetensors",
|
| 545 |
+
"vision_tower.blocks.21.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 546 |
+
"vision_tower.blocks.20.norm2.weight": "model-30-of-30.safetensors",
|
| 547 |
+
"vision_tower.blocks.20.norm1.weight": "model-30-of-30.safetensors",
|
| 548 |
+
"vision_tower.blocks.20.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 549 |
+
"vision_tower.blocks.2.norm2.weight": "model-30-of-30.safetensors",
|
| 550 |
+
"vision_tower.blocks.2.norm1.weight": "model-30-of-30.safetensors",
|
| 551 |
+
"vision_tower.blocks.2.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 552 |
+
"vision_tower.blocks.19.norm2.weight": "model-30-of-30.safetensors",
|
| 553 |
+
"vision_tower.blocks.19.norm1.weight": "model-30-of-30.safetensors",
|
| 554 |
+
"vision_tower.blocks.19.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 555 |
+
"vision_tower.blocks.18.norm2.weight": "model-30-of-30.safetensors",
|
| 556 |
+
"vision_tower.blocks.18.norm1.weight": "model-30-of-30.safetensors",
|
| 557 |
+
"vision_tower.blocks.18.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 558 |
+
"vision_tower.blocks.17.norm2.weight": "model-30-of-30.safetensors",
|
| 559 |
+
"vision_tower.blocks.17.norm1.weight": "model-30-of-30.safetensors",
|
| 560 |
+
"vision_tower.blocks.17.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 561 |
+
"vision_tower.blocks.16.norm2.weight": "model-30-of-30.safetensors",
|
| 562 |
+
"vision_tower.blocks.16.norm1.weight": "model-30-of-30.safetensors",
|
| 563 |
+
"vision_tower.blocks.16.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 564 |
+
"vision_tower.blocks.15.norm2.weight": "model-30-of-30.safetensors",
|
| 565 |
+
"vision_tower.blocks.15.norm1.weight": "model-30-of-30.safetensors",
|
| 566 |
+
"vision_tower.blocks.15.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 567 |
+
"vision_tower.blocks.14.norm2.weight": "model-30-of-30.safetensors",
|
| 568 |
+
"vision_tower.blocks.14.norm1.weight": "model-30-of-30.safetensors",
|
| 569 |
+
"vision_tower.blocks.14.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 570 |
+
"vision_tower.blocks.13.norm2.weight": "model-30-of-30.safetensors",
|
| 571 |
+
"vision_tower.blocks.13.norm1.weight": "model-30-of-30.safetensors",
|
| 572 |
+
"vision_tower.blocks.13.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 573 |
+
"vision_tower.blocks.12.norm2.weight": "model-30-of-30.safetensors",
|
| 574 |
+
"vision_tower.blocks.12.norm1.weight": "model-30-of-30.safetensors",
|
| 575 |
+
"vision_tower.blocks.12.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 576 |
+
"vision_tower.blocks.11.norm2.weight": "model-30-of-30.safetensors",
|
| 577 |
+
"vision_tower.blocks.11.norm1.weight": "model-30-of-30.safetensors",
|
| 578 |
+
"vision_tower.blocks.11.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 579 |
+
"vision_tower.blocks.10.norm2.weight": "model-30-of-30.safetensors",
|
| 580 |
+
"vision_tower.blocks.10.norm1.weight": "model-30-of-30.safetensors",
|
| 581 |
+
"vision_tower.blocks.10.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 582 |
+
"vision_tower.blocks.1.norm2.weight": "model-30-of-30.safetensors",
|
| 583 |
+
"vision_tower.blocks.1.norm1.weight": "model-30-of-30.safetensors",
|
| 584 |
+
"vision_tower.blocks.1.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 585 |
+
"vision_tower.blocks.0.norm1.weight": "model-30-of-30.safetensors",
|
| 586 |
+
"vision_tower.blocks.0.mlp.down_proj.bias": "model-30-of-30.safetensors",
|
| 587 |
+
"vision_tower.blocks.0.attn.proj.bias": "model-30-of-30.safetensors",
|
| 588 |
+
"vision_tower.merger.mlp.2.weight": "model-30-of-30.safetensors",
|
| 589 |
+
"vision_tower.blocks.9.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 590 |
+
"vision_tower.blocks.8.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 591 |
+
"vision_tower.blocks.7.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 592 |
+
"vision_tower.blocks.6.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 593 |
+
"vision_tower.blocks.5.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 594 |
+
"vision_tower.blocks.4.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 595 |
+
"vision_tower.blocks.31.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 596 |
+
"vision_tower.blocks.30.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 597 |
+
"vision_tower.blocks.3.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 598 |
+
"vision_tower.blocks.29.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 599 |
+
"vision_tower.blocks.28.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 600 |
+
"vision_tower.blocks.27.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 601 |
+
"vision_tower.blocks.26.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 602 |
+
"vision_tower.blocks.25.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 603 |
+
"vision_tower.blocks.24.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 604 |
+
"vision_tower.blocks.23.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 605 |
+
"vision_tower.blocks.22.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 606 |
+
"vision_tower.blocks.21.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 607 |
+
"vision_tower.blocks.20.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 608 |
+
"vision_tower.blocks.2.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 609 |
+
"vision_tower.blocks.19.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 610 |
+
"vision_tower.blocks.18.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 611 |
+
"vision_tower.blocks.17.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 612 |
+
"vision_tower.blocks.16.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 613 |
+
"vision_tower.blocks.15.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 614 |
+
"vision_tower.blocks.14.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 615 |
+
"vision_tower.blocks.13.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 616 |
+
"vision_tower.blocks.12.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 617 |
+
"vision_tower.blocks.11.mlp.down_proj.weight": "model-30-of-30.safetensors",
|
| 618 |
+
"vision_tower.blocks.10.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 619 |
+
"vision_tower.blocks.1.mlp.gate_proj.weight": "model-30-of-30.safetensors",
|
| 620 |
+
"vision_tower.blocks.0.mlp.up_proj.weight": "model-30-of-30.safetensors",
|
| 621 |
+
"vision_tower.blocks.8.attn.proj.weight": "model-30-of-30.safetensors",
|
| 622 |
+
"vision_tower.blocks.5.attn.proj.weight": "model-30-of-30.safetensors",
|
| 623 |
+
"vision_tower.blocks.29.attn.proj.weight": "model-30-of-30.safetensors",
|
| 624 |
+
"vision_tower.blocks.26.attn.proj.weight": "model-30-of-30.safetensors",
|
| 625 |
+
"vision_tower.blocks.23.attn.proj.weight": "model-30-of-30.safetensors",
|
| 626 |
+
"vision_tower.blocks.20.attn.proj.weight": "model-30-of-30.safetensors",
|
| 627 |
+
"vision_tower.blocks.2.attn.proj.weight": "model-30-of-30.safetensors",
|
| 628 |
+
"vision_tower.blocks.17.attn.proj.weight": "model-30-of-30.safetensors",
|
| 629 |
+
"vision_tower.blocks.14.attn.proj.weight": "model-30-of-30.safetensors",
|
| 630 |
+
"vision_tower.blocks.11.attn.proj.weight": "model-30-of-30.safetensors",
|
| 631 |
+
"vision_tower.patch_embed.proj.weight": "model-30-of-30.safetensors",
|
| 632 |
+
"vision_tower.merger.mlp.0.bias": "model-30-of-30.safetensors",
|
| 633 |
+
"vision_tower.blocks.8.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 634 |
+
"vision_tower.blocks.5.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 635 |
+
"vision_tower.blocks.29.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 636 |
+
"vision_tower.blocks.26.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 637 |
+
"vision_tower.blocks.23.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 638 |
+
"vision_tower.blocks.20.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 639 |
+
"vision_tower.blocks.2.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 640 |
+
"vision_tower.blocks.17.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 641 |
+
"vision_tower.blocks.14.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 642 |
+
"vision_tower.blocks.11.attn.qkv.bias": "model-30-of-30.safetensors",
|
| 643 |
+
"vision_tower.blocks.9.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 644 |
+
"vision_tower.blocks.8.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 645 |
+
"vision_tower.blocks.6.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 646 |
+
"vision_tower.blocks.5.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 647 |
+
"vision_tower.blocks.30.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 648 |
+
"vision_tower.blocks.3.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 649 |
+
"vision_tower.blocks.29.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 650 |
+
"vision_tower.blocks.27.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 651 |
+
"vision_tower.blocks.26.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 652 |
+
"vision_tower.blocks.24.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 653 |
+
"vision_tower.blocks.23.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 654 |
+
"vision_tower.blocks.21.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 655 |
+
"vision_tower.blocks.20.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 656 |
+
"vision_tower.blocks.2.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 657 |
+
"vision_tower.blocks.18.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 658 |
+
"vision_tower.blocks.17.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 659 |
+
"vision_tower.blocks.15.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 660 |
+
"vision_tower.blocks.14.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 661 |
+
"vision_tower.blocks.12.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 662 |
+
"vision_tower.blocks.11.mlp.up_proj.bias": "model-30-of-30.safetensors",
|
| 663 |
+
"vision_tower.blocks.0.mlp.gate_proj.bias": "model-30-of-30.safetensors",
|
| 664 |
+
"vision_tower.blocks.7.attn.proj.bias": "model-30-of-30.safetensors",
|
| 665 |
+
"vision_tower.blocks.4.attn.proj.bias": "model-30-of-30.safetensors",
|
| 666 |
+
"vision_tower.blocks.31.attn.proj.bias": "model-30-of-30.safetensors",
|
| 667 |
+
"vision_tower.blocks.28.attn.proj.bias": "model-30-of-30.safetensors",
|
| 668 |
+
"vision_tower.blocks.25.attn.proj.bias": "model-30-of-30.safetensors",
|
| 669 |
+
"vision_tower.blocks.22.attn.proj.bias": "model-30-of-30.safetensors",
|
| 670 |
+
"vision_tower.blocks.19.attn.proj.bias": "model-30-of-30.safetensors",
|
| 671 |
+
"vision_tower.blocks.16.attn.proj.bias": "model-30-of-30.safetensors",
|
| 672 |
+
"vision_tower.blocks.13.attn.proj.bias": "model-30-of-30.safetensors",
|
| 673 |
+
"vision_tower.blocks.10.attn.proj.bias": "model-30-of-30.safetensors",
|
| 674 |
+
"vision_tower.blocks.1.attn.proj.bias": "model-30-of-30.safetensors",
|
| 675 |
+
"language_model.model.layers.3.self_attn.k_proj.bias": "model-4-of-30.safetensors",
|
| 676 |
+
"language_model.model.layers.3.self_attn.q_proj.bias": "model-4-of-30.safetensors",
|
| 677 |
+
"language_model.model.layers.3.self_attn.k_proj.weight": "model-4-of-30.safetensors",
|
| 678 |
+
"language_model.model.layers.3.self_attn.q_proj.weight": "model-4-of-30.safetensors",
|
| 679 |
+
"language_model.model.layers.3.mlp.up_proj.weight": "model-4-of-30.safetensors",
|
| 680 |
+
"language_model.model.layers.3.mlp.down_proj.weight": "model-4-of-30.safetensors",
|
| 681 |
+
"language_model.model.layers.3.mlp.gate_proj.weight": "model-4-of-30.safetensors",
|
| 682 |
+
"language_model.model.layers.3.post_attention_layernorm.weight": "model-4-of-30.safetensors",
|
| 683 |
+
"language_model.model.layers.3.input_layernorm.weight": "model-4-of-30.safetensors",
|
| 684 |
+
"language_model.model.layers.3.self_attn.v_proj.bias": "model-4-of-30.safetensors",
|
| 685 |
+
"language_model.model.layers.3.self_attn.o_proj.weight": "model-4-of-30.safetensors",
|
| 686 |
+
"language_model.model.layers.3.self_attn.v_proj.weight": "model-4-of-30.safetensors",
|
| 687 |
+
"language_model.model.layers.10.self_attn.k_proj.bias": "model-11-of-30.safetensors",
|
| 688 |
+
"language_model.model.layers.10.self_attn.q_proj.bias": "model-11-of-30.safetensors",
|
| 689 |
+
"language_model.model.layers.10.self_attn.k_proj.weight": "model-11-of-30.safetensors",
|
| 690 |
+
"language_model.model.layers.10.self_attn.q_proj.weight": "model-11-of-30.safetensors",
|
| 691 |
+
"language_model.model.layers.10.mlp.up_proj.weight": "model-11-of-30.safetensors",
|
| 692 |
+
"language_model.model.layers.10.mlp.down_proj.weight": "model-11-of-30.safetensors",
|
| 693 |
+
"language_model.model.layers.10.mlp.gate_proj.weight": "model-11-of-30.safetensors",
|
| 694 |
+
"language_model.model.layers.10.post_attention_layernorm.weight": "model-11-of-30.safetensors",
|
| 695 |
+
"language_model.model.layers.10.input_layernorm.weight": "model-11-of-30.safetensors",
|
| 696 |
+
"language_model.model.layers.10.self_attn.v_proj.bias": "model-11-of-30.safetensors",
|
| 697 |
+
"language_model.model.layers.10.self_attn.o_proj.weight": "model-11-of-30.safetensors",
|
| 698 |
+
"language_model.model.layers.10.self_attn.v_proj.weight": "model-11-of-30.safetensors",
|
| 699 |
+
"language_model.model.layers.13.self_attn.k_proj.bias": "model-14-of-30.safetensors",
|
| 700 |
+
"language_model.model.layers.13.self_attn.q_proj.bias": "model-14-of-30.safetensors",
|
| 701 |
+
"language_model.model.layers.13.self_attn.k_proj.weight": "model-14-of-30.safetensors",
|
| 702 |
+
"language_model.model.layers.13.self_attn.q_proj.weight": "model-14-of-30.safetensors",
|
| 703 |
+
"language_model.model.layers.13.mlp.up_proj.weight": "model-14-of-30.safetensors",
|
| 704 |
+
"language_model.model.layers.13.mlp.down_proj.weight": "model-14-of-30.safetensors",
|
| 705 |
+
"language_model.model.layers.13.mlp.gate_proj.weight": "model-14-of-30.safetensors",
|
| 706 |
+
"language_model.model.layers.13.post_attention_layernorm.weight": "model-14-of-30.safetensors",
|
| 707 |
+
"language_model.model.layers.13.input_layernorm.weight": "model-14-of-30.safetensors",
|
| 708 |
+
"language_model.model.layers.13.self_attn.v_proj.bias": "model-14-of-30.safetensors",
|
| 709 |
+
"language_model.model.layers.13.self_attn.o_proj.weight": "model-14-of-30.safetensors",
|
| 710 |
+
"language_model.model.layers.13.self_attn.v_proj.weight": "model-14-of-30.safetensors",
|
| 711 |
+
"language_model.model.layers.2.self_attn.k_proj.bias": "model-3-of-30.safetensors",
|
| 712 |
+
"language_model.model.layers.2.self_attn.q_proj.bias": "model-3-of-30.safetensors",
|
| 713 |
+
"language_model.model.layers.2.self_attn.k_proj.weight": "model-3-of-30.safetensors",
|
| 714 |
+
"language_model.model.layers.2.self_attn.q_proj.weight": "model-3-of-30.safetensors",
|
| 715 |
+
"language_model.model.layers.2.mlp.up_proj.weight": "model-3-of-30.safetensors",
|
| 716 |
+
"language_model.model.layers.2.mlp.down_proj.weight": "model-3-of-30.safetensors",
|
| 717 |
+
"language_model.model.layers.2.mlp.gate_proj.weight": "model-3-of-30.safetensors",
|
| 718 |
+
"language_model.model.layers.2.post_attention_layernorm.weight": "model-3-of-30.safetensors",
|
| 719 |
+
"language_model.model.layers.2.input_layernorm.weight": "model-3-of-30.safetensors",
|
| 720 |
+
"language_model.model.layers.2.self_attn.v_proj.bias": "model-3-of-30.safetensors",
|
| 721 |
+
"language_model.model.layers.2.self_attn.o_proj.weight": "model-3-of-30.safetensors",
|
| 722 |
+
"language_model.model.layers.2.self_attn.v_proj.weight": "model-3-of-30.safetensors",
|
| 723 |
+
"language_model.model.layers.17.self_attn.k_proj.bias": "model-18-of-30.safetensors",
|
| 724 |
+
"language_model.model.layers.17.self_attn.q_proj.bias": "model-18-of-30.safetensors",
|
| 725 |
+
"language_model.model.layers.17.self_attn.k_proj.weight": "model-18-of-30.safetensors",
|
| 726 |
+
"language_model.model.layers.17.self_attn.q_proj.weight": "model-18-of-30.safetensors",
|
| 727 |
+
"language_model.model.layers.17.mlp.up_proj.weight": "model-18-of-30.safetensors",
|
| 728 |
+
"language_model.model.layers.17.mlp.down_proj.weight": "model-18-of-30.safetensors",
|
| 729 |
+
"language_model.model.layers.17.mlp.gate_proj.weight": "model-18-of-30.safetensors",
|
| 730 |
+
"language_model.model.layers.17.post_attention_layernorm.weight": "model-18-of-30.safetensors",
|
| 731 |
+
"language_model.model.layers.17.input_layernorm.weight": "model-18-of-30.safetensors",
|
| 732 |
+
"language_model.model.layers.17.self_attn.v_proj.bias": "model-18-of-30.safetensors",
|
| 733 |
+
"language_model.model.layers.17.self_attn.o_proj.weight": "model-18-of-30.safetensors",
|
| 734 |
+
"language_model.model.layers.17.self_attn.v_proj.weight": "model-18-of-30.safetensors"
|
| 735 |
+
}
|
| 736 |
+
}
|
modeling_opencua.py
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ------------------------------------------------------------------------------
|
| 2 |
+
# OpenCUA‑7B Model
|
| 3 |
+
#
|
| 4 |
+
# This implementation is adapted from the Qwen2‑VL reference code in
|
| 5 |
+
# Hugging Face Transformers v4.53.0:
|
| 6 |
+
# https://github.com/huggingface/transformers/tree/v4.53.0/src/transformers/models/qwen2_5_vl
|
| 7 |
+
#
|
| 8 |
+
# Checkpoint used for weight initialisation:
|
| 9 |
+
# "Qwen/Qwen2.5-VL-7B-Instruct" – https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct
|
| 10 |
+
#
|
| 11 |
+
# Key modifications
|
| 12 |
+
# -----------------
|
| 13 |
+
# • Replaced Multimodal Rotary Position Embedding (M‑RoPE) with 1‑D RoPE for
|
| 14 |
+
# compatibility with OpenCUA training settings.
|
| 15 |
+
# • Wrapped vision encoder and language model into a single
|
| 16 |
+
# `OpenCUAForConditionalGeneration` class.
|
| 17 |
+
# • Simplified weight initialisation — this file targets inference / fine‑tuning,
|
| 18 |
+
# not training from scratch.
|
| 19 |
+
#
|
| 20 |
+
# Copyright (c) 2025 XLANG Lab, The University of Hong Kong
|
| 21 |
+
#
|
| 22 |
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 23 |
+
# of this software and associated documentation files (the “Software”), to deal
|
| 24 |
+
# in the Software without restriction, including without limitation the rights
|
| 25 |
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 26 |
+
# copies of the Software, and to permit persons to whom the Software is
|
| 27 |
+
# furnished to do so, subject to the following conditions:
|
| 28 |
+
#
|
| 29 |
+
# The above copyright notice and this permission notice shall be included in all
|
| 30 |
+
# copies or substantial portions of the Software.
|
| 31 |
+
#
|
| 32 |
+
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 33 |
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 34 |
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 35 |
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 36 |
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 37 |
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 38 |
+
# SOFTWARE.
|
| 39 |
+
#
|
| 40 |
+
# ------------------------------------------------------------------------------
|
| 41 |
+
# Prohibited Uses & Additional Disclaimer
|
| 42 |
+
# ---------------------------------------
|
| 43 |
+
# • The Software may **not** be used for any purpose or activity that violates
|
| 44 |
+
# applicable laws or regulations in any jurisdiction.
|
| 45 |
+
# • The authors, contributors, and copyright holders are **not responsible**
|
| 46 |
+
# for any illegal, unethical, or harmful use of the Software, nor for any
|
| 47 |
+
# direct or indirect damages resulting from such use.
|
| 48 |
+
# • Use of the “OpenCUA” name, logo, or trademarks does **not** imply any
|
| 49 |
+
# endorsement or affiliation unless a separate written permission is obtained.
|
| 50 |
+
|
| 51 |
+
import torch
|
| 52 |
+
import torch.nn as nn
|
| 53 |
+
from transformers.cache_utils import Cache
|
| 54 |
+
from transformers.modeling_utils import PreTrainedModel
|
| 55 |
+
from transformers.models.llava.modeling_llava import LlavaCausalLMOutputWithPast
|
| 56 |
+
|
| 57 |
+
from .configuration_opencua import OpenCUAConfig
|
| 58 |
+
from transformers.models.qwen2_5_vl.modeling_qwen2_5_vl import Qwen2_5_VisionTransformerPretrainedModel
|
| 59 |
+
from transformers.models.qwen2.modeling_qwen2 import Qwen2ForCausalLM
|
| 60 |
+
|
| 61 |
+
from typing import Optional
|
| 62 |
+
|
| 63 |
+
class OpenCUAPreTrainedModel(PreTrainedModel):
|
| 64 |
+
config_class = OpenCUAConfig
|
| 65 |
+
base_model_prefix = "language_model"
|
| 66 |
+
_no_split_modules = ["Qwen2_5_VisionTransformerPretrainedModel", "Qwen2DecoderLayer"]
|
| 67 |
+
_skip_keys_device_placement = "past_key_values"
|
| 68 |
+
_supports_flash_attn_2 = True
|
| 69 |
+
|
| 70 |
+
supports_gradient_checkpointing = True
|
| 71 |
+
|
| 72 |
+
_supports_sdpa = True
|
| 73 |
+
|
| 74 |
+
def _init_weights(self, module):
|
| 75 |
+
# important: this ported version of Llava isn't meant for training from scratch - only
|
| 76 |
+
# inference and fine-tuning - so the proper init weights code has been removed - the original codebase
|
| 77 |
+
# https://github.com/haotian-liu/LLaVA/tree/main/llava should serve for that purpose
|
| 78 |
+
std = (
|
| 79 |
+
self.config.initializer_range
|
| 80 |
+
if hasattr(self.config, "initializer_range")
|
| 81 |
+
else self.config.text_config.initializer_range
|
| 82 |
+
)
|
| 83 |
+
|
| 84 |
+
if hasattr(module, "class_embedding"):
|
| 85 |
+
module.class_embedding.data.normal_(mean=0.0, std=std)
|
| 86 |
+
|
| 87 |
+
if isinstance(module, (nn.Linear, nn.Conv2d)):
|
| 88 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
| 89 |
+
if module.bias is not None:
|
| 90 |
+
module.bias.data.zero_()
|
| 91 |
+
elif isinstance(module, nn.Embedding):
|
| 92 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
| 93 |
+
if module.padding_idx is not None:
|
| 94 |
+
module.weight.data[module.padding_idx].zero_()
|
| 95 |
+
|
| 96 |
+
class OpenCUAForConditionalGeneration(OpenCUAPreTrainedModel):
|
| 97 |
+
|
| 98 |
+
def __init__(self, config: OpenCUAConfig):
|
| 99 |
+
super().__init__(config)
|
| 100 |
+
self.vision_tower = Qwen2_5_VisionTransformerPretrainedModel(config.vision_config)
|
| 101 |
+
self.language_model = Qwen2ForCausalLM(config.text_config)
|
| 102 |
+
self._supports_sdpa = True
|
| 103 |
+
self.post_init()
|
| 104 |
+
|
| 105 |
+
# 使用 property 来创建动态属性
|
| 106 |
+
@property
|
| 107 |
+
def model(self):
|
| 108 |
+
return self.language_model.model
|
| 109 |
+
|
| 110 |
+
@property
|
| 111 |
+
def lm_head(self):
|
| 112 |
+
return self.language_model.lm_head
|
| 113 |
+
|
| 114 |
+
def get_input_embeddings(self):
|
| 115 |
+
return self.language_model.get_input_embeddings()
|
| 116 |
+
|
| 117 |
+
def set_input_embeddings(self, value):
|
| 118 |
+
self.language_model.set_input_embeddings(value)
|
| 119 |
+
|
| 120 |
+
def get_output_embeddings(self):
|
| 121 |
+
return self.language_model.get_output_embeddings()
|
| 122 |
+
|
| 123 |
+
def set_output_embeddings(self, new_embeddings):
|
| 124 |
+
self.language_model.set_output_embeddings(new_embeddings)
|
| 125 |
+
|
| 126 |
+
def set_decoder(self, decoder):
|
| 127 |
+
self.language_model.set_decoder(decoder)
|
| 128 |
+
|
| 129 |
+
def get_decoder(self):
|
| 130 |
+
return self.language_model.get_decoder()
|
| 131 |
+
|
| 132 |
+
def tie_weights(self):
|
| 133 |
+
return self.language_model.tie_weights()
|
| 134 |
+
|
| 135 |
+
def resize_token_embeddings(self, new_num_tokens: int | None = None, pad_to_multiple_of=None) -> nn.Embedding:
|
| 136 |
+
model_embeds = self.language_model.resize_token_embeddings(
|
| 137 |
+
new_num_tokens, pad_to_multiple_of)
|
| 138 |
+
# update vocab size
|
| 139 |
+
self.config.text_config.vocab_size = model_embeds.num_embeddings
|
| 140 |
+
self.vocab_size = model_embeds.num_embeddings
|
| 141 |
+
return model_embeds
|
| 142 |
+
|
| 143 |
+
def _merge_input_ids_with_image_features(
|
| 144 |
+
self,
|
| 145 |
+
image_features: torch.Tensor,
|
| 146 |
+
feature_lengths: list[int],
|
| 147 |
+
inputs_embeds: torch.Tensor,
|
| 148 |
+
input_ids: torch.Tensor,
|
| 149 |
+
attention_mask: torch.Tensor,
|
| 150 |
+
labels: torch.Tensor | None = None):
|
| 151 |
+
"""
|
| 152 |
+
Args:
|
| 153 |
+
image_features (:obj:`torch.Tensor` of shape :obj:`(num_image_tokens, embed_dim)`):
|
| 154 |
+
The image features to merge with the input embeddings.
|
| 155 |
+
feature_lengths: the length of image feature.
|
| 156 |
+
inputs_embeds (:obj:`torch.Tensor` of shape :obj:`(batch_size, sequence_length, embed_dim)`):
|
| 157 |
+
The input embeddings.
|
| 158 |
+
input_ids (:obj:`torch.Tensor` of shape :obj:`(batch_size, sequence_length)`):
|
| 159 |
+
The input ids.
|
| 160 |
+
attention_mask (:obj:`torch.Tensor` of shape :obj:`(batch_size, sequence_length)`):
|
| 161 |
+
The attention mask.
|
| 162 |
+
labels (:obj:`torch.Tensor` of shape :obj:`(batch_size, sequence_length)`, *optional*):
|
| 163 |
+
The labels.
|
| 164 |
+
"""
|
| 165 |
+
|
| 166 |
+
image_token_index: int = self.config.media_placeholder_token_id
|
| 167 |
+
pad_token_id: int = self.config.pad_token_id
|
| 168 |
+
ignore_index: int = self.config.ignore_index
|
| 169 |
+
|
| 170 |
+
_, embed_dim = image_features.shape
|
| 171 |
+
|
| 172 |
+
batch_size, sequence_length = input_ids.shape
|
| 173 |
+
left_padding = not torch.sum(
|
| 174 |
+
input_ids[:, -1] == torch.tensor(pad_token_id))
|
| 175 |
+
|
| 176 |
+
# 1. Create a mask to know where special image tokens are
|
| 177 |
+
_token_occupation_table = torch.ones_like(input_ids.flatten())
|
| 178 |
+
_token_occupation_table[input_ids.flatten() == image_token_index] = \
|
| 179 |
+
torch.tensor(feature_lengths,
|
| 180 |
+
dtype=torch.long, device=input_ids.device)
|
| 181 |
+
_token_occupation_table = _token_occupation_table.reshape(
|
| 182 |
+
input_ids.shape)
|
| 183 |
+
|
| 184 |
+
max_embed_dim = _token_occupation_table.sum(-1).max().item()
|
| 185 |
+
assert max_embed_dim >= sequence_length, (
|
| 186 |
+
f"The maximum embedding dimension ({max_embed_dim}) is less than the sequence length ({sequence_length})"
|
| 187 |
+
)
|
| 188 |
+
batch_indices, non_image_indices = torch.where(input_ids != image_token_index)
|
| 189 |
+
|
| 190 |
+
# 2. Compute the positions where text should be written
|
| 191 |
+
# Calculate new positions for text tokens in merged image-text sequence.
|
| 192 |
+
new_token_positions = torch.cumsum(_token_occupation_table, -1) - 1
|
| 193 |
+
nb_image_pad = max_embed_dim - 1 - new_token_positions[:, -1]
|
| 194 |
+
if left_padding:
|
| 195 |
+
new_token_positions += nb_image_pad[:, None] # offset for left padding
|
| 196 |
+
text_to_overwrite = new_token_positions[batch_indices, non_image_indices]
|
| 197 |
+
|
| 198 |
+
# 3. Create the full embedding, already padded to the maximum position
|
| 199 |
+
final_embedding = torch.zeros(
|
| 200 |
+
batch_size, max_embed_dim, embed_dim, dtype=inputs_embeds.dtype, device=inputs_embeds.device
|
| 201 |
+
)
|
| 202 |
+
final_attention_mask = torch.zeros(
|
| 203 |
+
batch_size, max_embed_dim, dtype=attention_mask.dtype, device=inputs_embeds.device
|
| 204 |
+
)
|
| 205 |
+
if labels is not None:
|
| 206 |
+
final_labels = torch.full(
|
| 207 |
+
(batch_size, max_embed_dim), ignore_index, dtype=input_ids.dtype, device=input_ids.device
|
| 208 |
+
)
|
| 209 |
+
# In case the Vision model or the Language model has been offloaded to CPU, we need to manually
|
| 210 |
+
# set the corresponding tensors into their correct target device.
|
| 211 |
+
target_device = inputs_embeds.device
|
| 212 |
+
batch_indices, non_image_indices, text_to_overwrite = (
|
| 213 |
+
batch_indices.to(target_device),
|
| 214 |
+
non_image_indices.to(target_device),
|
| 215 |
+
text_to_overwrite.to(target_device),
|
| 216 |
+
)
|
| 217 |
+
if attention_mask is not None:
|
| 218 |
+
attention_mask = attention_mask.to(target_device)
|
| 219 |
+
|
| 220 |
+
# 4. Fill the embeddings based on the mask.
|
| 221 |
+
final_embedding[batch_indices, text_to_overwrite] = inputs_embeds[batch_indices, non_image_indices]
|
| 222 |
+
final_attention_mask[batch_indices, text_to_overwrite] = attention_mask[batch_indices, non_image_indices]
|
| 223 |
+
if labels is not None:
|
| 224 |
+
final_labels[batch_indices, text_to_overwrite] = labels[batch_indices, non_image_indices]
|
| 225 |
+
|
| 226 |
+
# 5. Fill the embeddings corresponding to the images. Anything that is not `text_positions` needs filling (#29835)
|
| 227 |
+
image_to_overwrite = torch.full(
|
| 228 |
+
(batch_size, max_embed_dim), True, dtype=torch.bool, device=inputs_embeds.device
|
| 229 |
+
)
|
| 230 |
+
image_to_overwrite[batch_indices, text_to_overwrite] = False
|
| 231 |
+
image_to_overwrite &= image_to_overwrite.cumsum(-1) - 1 >= nb_image_pad[:, None].to(target_device)
|
| 232 |
+
|
| 233 |
+
if image_to_overwrite.sum() != image_features.shape[:-1].numel():
|
| 234 |
+
raise ValueError(
|
| 235 |
+
f"The input provided to the model are wrong. The number of image tokens is {image_to_overwrite.sum()} while"
|
| 236 |
+
f" the number of image features given to the model is {image_features.shape[:-1].numel()}. "
|
| 237 |
+
"This prevents correct indexing and breaks batch generation."
|
| 238 |
+
)
|
| 239 |
+
|
| 240 |
+
final_embedding[image_to_overwrite] = image_features.contiguous().reshape(-1, embed_dim).to(target_device)
|
| 241 |
+
final_attention_mask |= image_to_overwrite
|
| 242 |
+
position_ids = (final_attention_mask.cumsum(-1) - 1).masked_fill_((final_attention_mask == 0), 1)
|
| 243 |
+
|
| 244 |
+
# 6. Mask out the embedding at padding positions, as we later use the past_key_value value to determine the non-attended tokens.
|
| 245 |
+
batch_indices, pad_indices = torch.where(input_ids == pad_token_id)
|
| 246 |
+
indices_to_mask = new_token_positions[batch_indices, pad_indices]
|
| 247 |
+
|
| 248 |
+
final_embedding[batch_indices, indices_to_mask] = 0
|
| 249 |
+
|
| 250 |
+
if labels is None:
|
| 251 |
+
final_labels = None
|
| 252 |
+
return final_embedding, final_attention_mask, final_labels, position_ids
|
| 253 |
+
|
| 254 |
+
def _extract_image_features(self,
|
| 255 |
+
pixel_values: torch.FloatTensor | list[torch.FloatTensor],
|
| 256 |
+
image_grid_thw: torch.FloatTensor,
|
| 257 |
+
):
|
| 258 |
+
"""
|
| 259 |
+
Args:
|
| 260 |
+
pixel_values (:obj:`torch.FloatTensor` of shape :obj:`(sum_num_image_tokens, channels)`):
|
| 261 |
+
The pixel values of the images processed by image processor.
|
| 262 |
+
image_grid_thw: (B,3)
|
| 263 |
+
|
| 264 |
+
Returns:
|
| 265 |
+
selected_image_feature (:obj:`torch.FloatTensor` of shape :obj:`(num_image_tokens, embed_dim)`):
|
| 266 |
+
The selected image features to use as input to the projector head.
|
| 267 |
+
|
| 268 |
+
"""
|
| 269 |
+
|
| 270 |
+
assert len(image_grid_thw.shape)==2 and image_grid_thw.shape[1]==3, f"image_grid_thw must be a 2D tensor with shape (batched, 3), but got {image_grid_thw.shape}"
|
| 271 |
+
if isinstance(pixel_values, list):
|
| 272 |
+
pixel_values = torch.cat(pixel_values, dim=0)
|
| 273 |
+
image_features_ = self.vision_tower(pixel_values, grid_thw=image_grid_thw)
|
| 274 |
+
image_features_list = []
|
| 275 |
+
start_idx = 0
|
| 276 |
+
for i, grid_thw in enumerate(image_grid_thw):
|
| 277 |
+
end_idx = start_idx + (grid_thw[0] * grid_thw[1] * grid_thw[2]) // 4
|
| 278 |
+
image_features_list.append(image_features_[start_idx:end_idx, :])
|
| 279 |
+
start_idx = end_idx
|
| 280 |
+
|
| 281 |
+
selected_image_feature = torch.cat(image_features_list, dim=0)
|
| 282 |
+
feature_lengths = [x.size(0) for x in image_features_list]
|
| 283 |
+
return selected_image_feature, feature_lengths
|
| 284 |
+
|
| 285 |
+
def get_placeholder_mask(
|
| 286 |
+
self,
|
| 287 |
+
input_ids: torch.LongTensor,
|
| 288 |
+
inputs_embeds: torch.FloatTensor,
|
| 289 |
+
image_features: Optional[torch.FloatTensor] = None,
|
| 290 |
+
video_features: Optional[torch.FloatTensor] = None,
|
| 291 |
+
):
|
| 292 |
+
"""
|
| 293 |
+
Obtains multimodal placeholder mask from `input_ids` or `inputs_embeds`, and checks that the placeholder token count is
|
| 294 |
+
equal to the length of multimodal features. If the lengths are different, an error is raised.
|
| 295 |
+
"""
|
| 296 |
+
if input_ids is None:
|
| 297 |
+
special_image_mask = inputs_embeds == self.get_input_embeddings()(
|
| 298 |
+
torch.tensor(self.config.media_placeholder_token_id, dtype=torch.long, device=inputs_embeds.device)
|
| 299 |
+
)
|
| 300 |
+
special_image_mask = special_image_mask.all(-1)
|
| 301 |
+
else:
|
| 302 |
+
special_image_mask = input_ids == self.config.media_placeholder_token_id
|
| 303 |
+
|
| 304 |
+
n_image_tokens = special_image_mask.sum()
|
| 305 |
+
special_image_mask = special_image_mask.unsqueeze(-1).expand_as(inputs_embeds).to(inputs_embeds.device)
|
| 306 |
+
if image_features is not None and inputs_embeds[special_image_mask].numel() != image_features.numel():
|
| 307 |
+
raise ValueError(
|
| 308 |
+
f"Image features and image tokens do not match: tokens: {n_image_tokens}, features {image_features.shape[0]}"
|
| 309 |
+
)
|
| 310 |
+
|
| 311 |
+
return special_image_mask, None
|
| 312 |
+
|
| 313 |
+
def forward(
|
| 314 |
+
self,
|
| 315 |
+
input_ids: torch.LongTensor | None = None,
|
| 316 |
+
pixel_values: torch.FloatTensor | list[torch.FloatTensor] | None = None,
|
| 317 |
+
image_grid_thw: torch.Tensor = None,
|
| 318 |
+
attention_mask: torch.Tensor | None = None,
|
| 319 |
+
position_ids: torch.LongTensor | None = None,
|
| 320 |
+
past_key_values: list[torch.FloatTensor] | None = None,
|
| 321 |
+
inputs_embeds: torch.FloatTensor | None = None,
|
| 322 |
+
labels: torch.LongTensor | None = None,
|
| 323 |
+
use_cache: bool | None = None,
|
| 324 |
+
output_attentions: bool | None = None,
|
| 325 |
+
output_hidden_states: bool | None = None,
|
| 326 |
+
return_dict: bool | None = None,
|
| 327 |
+
**kwargs,
|
| 328 |
+
) -> tuple | LlavaCausalLMOutputWithPast:
|
| 329 |
+
r"""
|
| 330 |
+
Args:
|
| 331 |
+
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
| 332 |
+
Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
|
| 333 |
+
config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
|
| 334 |
+
(masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
|
| 335 |
+
|
| 336 |
+
```"""
|
| 337 |
+
if attention_mask is None:
|
| 338 |
+
attention_mask = torch.ones_like(input_ids)
|
| 339 |
+
|
| 340 |
+
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
|
| 341 |
+
output_hidden_states = (
|
| 342 |
+
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
|
| 343 |
+
)
|
| 344 |
+
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
| 345 |
+
if inputs_embeds is None:
|
| 346 |
+
# 1. Extra the input embeddings
|
| 347 |
+
inputs_embeds = self.get_input_embeddings()(input_ids)
|
| 348 |
+
|
| 349 |
+
# # 2. Merge text and images
|
| 350 |
+
# if pixel_values is not None and len(pixel_values) > 0 and input_ids.shape[1] != 1:
|
| 351 |
+
# image_feature, feature_lengths = self._extract_image_features(
|
| 352 |
+
# pixel_values, image_grid_thw)
|
| 353 |
+
|
| 354 |
+
# inputs_embeds = inputs_embeds.to(image_feature.dtype) # num_tokens, embed_dim
|
| 355 |
+
# inputs_embeds, attention_mask, labels, position_ids = \
|
| 356 |
+
# self._merge_input_ids_with_image_features(image_feature, feature_lengths, inputs_embeds, input_ids, attention_mask, labels
|
| 357 |
+
# )
|
| 358 |
+
|
| 359 |
+
# FIXME: build image embeddings without merging
|
| 360 |
+
if pixel_values is not None and len(pixel_values) > 0 and input_ids.shape[1] != 1:
|
| 361 |
+
image_embeds, feature_lengths = self._extract_image_features(pixel_values, image_grid_thw)
|
| 362 |
+
image_mask, _ = self.get_placeholder_mask(
|
| 363 |
+
input_ids, inputs_embeds=inputs_embeds, image_features=image_embeds
|
| 364 |
+
)
|
| 365 |
+
inputs_embeds = inputs_embeds.to(image_embeds.dtype)
|
| 366 |
+
inputs_embeds = inputs_embeds.masked_scatter(image_mask, image_embeds)
|
| 367 |
+
|
| 368 |
+
# In case input_ids.shape[1] == 1 & pixel_values==None & past_key_values != None, we are in the case of
|
| 369 |
+
# generation with cache
|
| 370 |
+
elif past_key_values is not None and pixel_values is not None and input_ids.shape[1] == 1:
|
| 371 |
+
# Retrieve the first layer to inspect the logits and mask out the hidden states
|
| 372 |
+
# that are set to 0
|
| 373 |
+
first_layer_past_key_value = past_key_values[0][0][:, :, :, 0]
|
| 374 |
+
|
| 375 |
+
# Sum all dimensions of head_dim (-2) to avoid random errors such as: https://github.com/huggingface/transformers/pull/28032#issuecomment-1863691941
|
| 376 |
+
batch_index, non_attended_tokens = torch.where(first_layer_past_key_value.float().sum(-2) == 0)
|
| 377 |
+
|
| 378 |
+
# Get the target length
|
| 379 |
+
target_length = input_ids.shape[1]
|
| 380 |
+
past_length = first_layer_past_key_value.shape[-1]
|
| 381 |
+
|
| 382 |
+
extended_attention_mask = torch.ones(
|
| 383 |
+
(attention_mask.shape[0], past_length),
|
| 384 |
+
dtype=attention_mask.dtype,
|
| 385 |
+
device=attention_mask.device,
|
| 386 |
+
)
|
| 387 |
+
|
| 388 |
+
# Filter out only the tokens that can be un-attended, this can happen
|
| 389 |
+
# if one uses Llava + Fused modules where the cache on the
|
| 390 |
+
# first iteration is already big enough, or if one passes custom cache
|
| 391 |
+
valid_indices = non_attended_tokens < extended_attention_mask.size(-1)
|
| 392 |
+
new_batch_index = batch_index[valid_indices]
|
| 393 |
+
new_non_attended_tokens = non_attended_tokens[valid_indices]
|
| 394 |
+
|
| 395 |
+
# Zero-out the places where we don't need to attend
|
| 396 |
+
extended_attention_mask[new_batch_index, new_non_attended_tokens] = 0
|
| 397 |
+
|
| 398 |
+
attention_mask = torch.cat((extended_attention_mask, attention_mask[:, -target_length:]), dim=1)
|
| 399 |
+
position_ids = torch.sum(attention_mask, dim=1).unsqueeze(-1) - 1
|
| 400 |
+
cu_seqlens = kwargs.pop("cu_seqlens", None)
|
| 401 |
+
outputs = self.language_model(
|
| 402 |
+
attention_mask=attention_mask,
|
| 403 |
+
position_ids=position_ids,
|
| 404 |
+
past_key_values=past_key_values,
|
| 405 |
+
inputs_embeds=inputs_embeds,
|
| 406 |
+
use_cache=use_cache,
|
| 407 |
+
output_attentions=output_attentions,
|
| 408 |
+
output_hidden_states=output_hidden_states,
|
| 409 |
+
return_dict=return_dict,
|
| 410 |
+
cu_seqlens=cu_seqlens,
|
| 411 |
+
**kwargs,
|
| 412 |
+
)
|
| 413 |
+
|
| 414 |
+
logits = outputs[0]
|
| 415 |
+
|
| 416 |
+
loss = None
|
| 417 |
+
if labels is not None:
|
| 418 |
+
# Shift so that tokens < n predict n
|
| 419 |
+
if attention_mask is not None:
|
| 420 |
+
shift_attention_mask = attention_mask[..., 1:]
|
| 421 |
+
shift_logits = logits[..., :-1, :][shift_attention_mask.to(logits.device) != 0].contiguous()
|
| 422 |
+
shift_labels = labels[..., 1:][shift_attention_mask.to(labels.device) != 0].contiguous()
|
| 423 |
+
else:
|
| 424 |
+
shift_logits = logits[..., :-1, :].contiguous()
|
| 425 |
+
shift_labels = labels[..., 1:].contiguous()
|
| 426 |
+
# Flatten the tokens
|
| 427 |
+
loss_fct = nn.CrossEntropyLoss()
|
| 428 |
+
loss = loss_fct(
|
| 429 |
+
shift_logits.view(-1, shift_logits.size(-1)), shift_labels.view(-1).to(shift_logits.device)
|
| 430 |
+
)
|
| 431 |
+
|
| 432 |
+
if not return_dict:
|
| 433 |
+
output = (logits,) + outputs[1:]
|
| 434 |
+
return (loss,) + output if loss is not None else output
|
| 435 |
+
|
| 436 |
+
return LlavaCausalLMOutputWithPast(
|
| 437 |
+
loss=loss,
|
| 438 |
+
logits=logits,
|
| 439 |
+
past_key_values=outputs.past_key_values,
|
| 440 |
+
hidden_states=outputs.hidden_states,
|
| 441 |
+
attentions=outputs.attentions,
|
| 442 |
+
)
|
| 443 |
+
|
| 444 |
+
def prepare_inputs_for_generation(
|
| 445 |
+
self, input_ids, past_key_values=None, inputs_embeds=None, pixel_values=None, image_grid_thw=None, attention_mask=None, **kwargs
|
| 446 |
+
):
|
| 447 |
+
if past_key_values is not None:
|
| 448 |
+
if isinstance(past_key_values, Cache):
|
| 449 |
+
cache_length = past_key_values.get_seq_length()
|
| 450 |
+
past_length = past_key_values.seen_tokens if hasattr(past_key_values, 'seen_tokens') else past_key_values.get_seq_length()
|
| 451 |
+
else:
|
| 452 |
+
cache_length = past_length = past_key_values[0][0].shape[2]
|
| 453 |
+
|
| 454 |
+
# Keep only the unprocessed tokens:
|
| 455 |
+
# 1 - If the length of the attention_mask exceeds the length of input_ids, then we are in a setting where
|
| 456 |
+
# some of the inputs are exclusively passed as part of the cache (e.g. when passing input_embeds as
|
| 457 |
+
# input)
|
| 458 |
+
if attention_mask is not None and attention_mask.shape[1] > input_ids.shape[1]:
|
| 459 |
+
input_ids = input_ids[:, -(attention_mask.shape[1] - past_length) :]
|
| 460 |
+
# 2 - If the past_length is smaller than input_ids', then input_ids holds all input tokens. We can discard
|
| 461 |
+
# input_ids based on the past_length.
|
| 462 |
+
elif past_length < input_ids.shape[1]:
|
| 463 |
+
input_ids = input_ids[:, past_length:]
|
| 464 |
+
# 3 - Otherwise (past_length >= input_ids.shape[1]), let's assume input_ids only has unprocessed tokens.
|
| 465 |
+
elif self.config.media_placeholder_token_id in input_ids:
|
| 466 |
+
input_ids = input_ids[:, input_ids.shape[1] - 1 :]
|
| 467 |
+
# If the cache has seen more tokens than it can hold, then the cache has a size limit. Let's discard the
|
| 468 |
+
# older attention values, as their corresponding values are not part of the input.
|
| 469 |
+
if cache_length < past_length and attention_mask is not None:
|
| 470 |
+
attention_mask = attention_mask[:, -(cache_length + input_ids.shape[1]) :]
|
| 471 |
+
|
| 472 |
+
position_ids = kwargs.get("position_ids", None)
|
| 473 |
+
if attention_mask is not None and position_ids is None:
|
| 474 |
+
# create position_ids on the fly for batch generation
|
| 475 |
+
position_ids = attention_mask.long().cumsum(-1) - 1
|
| 476 |
+
position_ids.masked_fill_(attention_mask == 0, 1)
|
| 477 |
+
if past_key_values:
|
| 478 |
+
position_ids = position_ids[:, -input_ids.shape[1] :]
|
| 479 |
+
|
| 480 |
+
# if `inputs_embeds` are passed, we only want to use them in the 1st generation step
|
| 481 |
+
if inputs_embeds is not None and past_key_values is None:
|
| 482 |
+
model_inputs = {"inputs_embeds": inputs_embeds}
|
| 483 |
+
else:
|
| 484 |
+
model_inputs = {"input_ids": input_ids}
|
| 485 |
+
|
| 486 |
+
model_inputs.update(
|
| 487 |
+
{
|
| 488 |
+
"position_ids": position_ids,
|
| 489 |
+
"past_key_values": past_key_values,
|
| 490 |
+
"use_cache": kwargs.get("use_cache"),
|
| 491 |
+
"attention_mask": attention_mask,
|
| 492 |
+
"pixel_values": pixel_values,
|
| 493 |
+
"image_grid_thw": image_grid_thw,
|
| 494 |
+
}
|
| 495 |
+
)
|
| 496 |
+
return model_inputs
|
| 497 |
+
|
| 498 |
+
def _reorder_cache(self, *args, **kwargs):
|
| 499 |
+
return self.language_model._reorder_cache(*args, **kwargs)
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"min_pixels": 3136,
|
| 3 |
+
"max_pixels": 12845056,
|
| 4 |
+
"patch_size": 14,
|
| 5 |
+
"temporal_patch_size": 2,
|
| 6 |
+
"merge_size": 2,
|
| 7 |
+
"image_mean": [
|
| 8 |
+
0.48145466,
|
| 9 |
+
0.4578275,
|
| 10 |
+
0.40821073
|
| 11 |
+
],
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.26862954,
|
| 14 |
+
0.26130258,
|
| 15 |
+
0.27577711
|
| 16 |
+
],
|
| 17 |
+
"image_processor_type": "Qwen2VLImageProcessor"
|
| 18 |
+
}
|
processing_opencua.py
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers.models.qwen2_5_vl.processing_qwen2_5_vl import Qwen2_5_VLProcessor
|
| 2 |
+
|
| 3 |
+
from transformers.activations import ACT2FN
|
| 4 |
+
from transformers.cache_utils import Cache
|
| 5 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 6 |
+
from transformers.feature_extraction_utils import BatchFeature
|
| 7 |
+
from transformers.image_utils import ImageInput
|
| 8 |
+
from transformers.modeling_flash_attention_utils import is_flash_attn_available
|
| 9 |
+
from transformers.modeling_layers import GradientCheckpointingLayer
|
| 10 |
+
from transformers.processing_utils import ImagesKwargs, MultiModalData, ProcessingKwargs, ProcessorMixin, Unpack, VideosKwargs
|
| 11 |
+
from transformers.tokenization_utils_base import PreTokenizedInput, TextInput
|
| 12 |
+
from transformers.utils import is_torchdynamo_compiling, logging
|
| 13 |
+
from transformers.video_utils import VideoInput
|
| 14 |
+
|
| 15 |
+
from transformers.models.qwen2_5_vl.processing_qwen2_5_vl import Qwen2_5_VLProcessorKwargs
|
| 16 |
+
|
| 17 |
+
import torch
|
| 18 |
+
import numpy as np
|
| 19 |
+
from typing import Union, Optional
|
| 20 |
+
|
| 21 |
+
# from typing import Union, Optional, TypedDict
|
| 22 |
+
from PIL import Image
|
| 23 |
+
|
| 24 |
+
if is_flash_attn_available():
|
| 25 |
+
pass
|
| 26 |
+
|
| 27 |
+
logger = logging.get_logger(__name__)
|
| 28 |
+
|
| 29 |
+
# class Qwen2_5_VLVideosProcessorKwargs(VideosKwargs, total=False):
|
| 30 |
+
# fps: Union[list[float], float]
|
| 31 |
+
|
| 32 |
+
# class TokenizerChatTemplateKwargs(TypedDict, total=False):
|
| 33 |
+
# """
|
| 34 |
+
# Keyword arguments for tokenizer's `apply_chat_template`, when it is called from within a processor.
|
| 35 |
+
|
| 36 |
+
# tools (`list[Dict]`, *optional*):
|
| 37 |
+
# A list of tools (callable functions) that will be accessible to the model. If the template does not
|
| 38 |
+
# support function calling, this argument will have no effect. Each tool should be passed as a JSON Schema,
|
| 39 |
+
# giving the name, description and argument types for the tool. See our
|
| 40 |
+
# [chat templating guide](https://huggingface.co/docs/transformers/main/en/chat_templating#automated-function-conversion-for-tool-use)
|
| 41 |
+
# for more information.
|
| 42 |
+
# documents (`list[dict[str, str]]`, *optional*):
|
| 43 |
+
# A list of dicts representing documents that will be accessible to the model if it is performing RAG
|
| 44 |
+
# (retrieval-augmented generation). If the template does not support RAG, this argument will have no
|
| 45 |
+
# effect. We recommend that each document should be a dict containing "title" and "text" keys. Please
|
| 46 |
+
# see the RAG section of the [chat templating guide](https://huggingface.co/docs/transformers/main/en/chat_templating#arguments-for-RAG)
|
| 47 |
+
# for examples of passing documents with chat templates.
|
| 48 |
+
# add_generation_prompt (bool, *optional*):
|
| 49 |
+
# If this is set, a prompt with the token(s) that indicate
|
| 50 |
+
# the start of an assistant message will be appended to the formatted output. This is useful when you want to generate a response from the model.
|
| 51 |
+
# Note that this argument will be passed to the chat template, and so it must be supported in the
|
| 52 |
+
# template for this argument to have any effect.
|
| 53 |
+
# continue_final_message (bool, *optional*):
|
| 54 |
+
# If this is set, the chat will be formatted so that the final
|
| 55 |
+
# message in the chat is open-ended, without any EOS tokens. The model will continue this message
|
| 56 |
+
# rather than starting a new one. This allows you to "prefill" part of
|
| 57 |
+
# the model's response for it. Cannot be used at the same time as `add_generation_prompt`.
|
| 58 |
+
# return_assistant_tokens_mask (`bool`, defaults to `False`):
|
| 59 |
+
# Whether to return a mask of the assistant generated tokens. For tokens generated by the assistant,
|
| 60 |
+
# the mask will contain 1. For user and system tokens, the mask will contain 0.
|
| 61 |
+
# This functionality is only available for chat templates that support it via the `{% generation %}` keyword.
|
| 62 |
+
# """
|
| 63 |
+
|
| 64 |
+
# tools: Optional[list[dict]] = None
|
| 65 |
+
# documents: Optional[list[dict[str, str]]] = None
|
| 66 |
+
# add_generation_prompt: Optional[bool] = False
|
| 67 |
+
# continue_final_message: Optional[bool] = False
|
| 68 |
+
# return_assistant_tokens_mask: Optional[bool] = False
|
| 69 |
+
|
| 70 |
+
# class ChatTemplateLoadKwargs(TypedDict, total=False):
|
| 71 |
+
# """
|
| 72 |
+
# Keyword arguments used to load multimodal data in processor chat templates.
|
| 73 |
+
|
| 74 |
+
# num_frames (`int`, *optional*):
|
| 75 |
+
# Number of frames to sample uniformly. If not passed, the whole video is loaded.
|
| 76 |
+
# load_audio_from_video (`bool`, *optional*):
|
| 77 |
+
# Whether to use the audio track of input video. If `True` the audio track will be loaded and passed to the
|
| 78 |
+
# processor. This flag has no effect if the model doesn't support audio modality.
|
| 79 |
+
# """
|
| 80 |
+
|
| 81 |
+
# sampling_rate: Optional[int] = 16_000
|
| 82 |
+
# load_audio_from_video: Optional[bool] = False
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
# class ProcessorChatTemplateKwargs(ChatTemplateLoadKwargs, TokenizerChatTemplateKwargs, total=False):
|
| 86 |
+
# """
|
| 87 |
+
# Keyword arguments for processor's `apply_chat_template`.
|
| 88 |
+
|
| 89 |
+
# tokenize (`bool`, *optional*, defaults to `False`):
|
| 90 |
+
# Whether to tokenize the output or not.
|
| 91 |
+
# return_dict (`bool`, defaults to `False`):
|
| 92 |
+
# Whether to return a dictionary with named outputs. Has no effect if tokenize is `False`.
|
| 93 |
+
# """
|
| 94 |
+
|
| 95 |
+
# tokenize: Optional[bool] = False
|
| 96 |
+
# return_dict: Optional[bool] = False
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
# class AllKwargsForChatTemplate(TypedDict, total=False):
|
| 100 |
+
# processor_kwargs: ProcessingKwargs
|
| 101 |
+
# mm_load_kwargs: ChatTemplateLoadKwargs
|
| 102 |
+
# template_kwargs: ProcessorChatTemplateKwargs
|
| 103 |
+
|
| 104 |
+
# class Qwen2_5_VLImagesKwargs(ImagesKwargs):
|
| 105 |
+
# min_pixels: Optional[int]
|
| 106 |
+
# max_pixels: Optional[int]
|
| 107 |
+
# patch_size: Optional[int]
|
| 108 |
+
# temporal_patch_size: Optional[int]
|
| 109 |
+
# merge_size: Optional[int]
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
# class Qwen2_5_VLProcessorKwargs(ProcessingKwargs, total=False):
|
| 113 |
+
# images_kwargs: Qwen2_5_VLImagesKwargs
|
| 114 |
+
# videos_kwargs: Qwen2_5_VLVideosProcessorKwargs
|
| 115 |
+
# _defaults = {
|
| 116 |
+
# "text_kwargs": {
|
| 117 |
+
# "padding": False,
|
| 118 |
+
# "return_mm_token_type_ids": False,
|
| 119 |
+
# },
|
| 120 |
+
# }
|
| 121 |
+
|
| 122 |
+
class OpenCUAProcessor(Qwen2_5_VLProcessor):
|
| 123 |
+
attributes = ["image_processor", "tokenizer", "video_processor"]
|
| 124 |
+
|
| 125 |
+
image_processor_class = "AutoImageProcessor"
|
| 126 |
+
video_processor_class = "AutoVideoProcessor"
|
| 127 |
+
tokenizer_class = "AutoTokenizer"
|
| 128 |
+
|
| 129 |
+
def __init__(self,
|
| 130 |
+
image_processor: None,
|
| 131 |
+
tokenizer: None,
|
| 132 |
+
video_processor: None,
|
| 133 |
+
**kwargs,
|
| 134 |
+
):
|
| 135 |
+
super().__init__(image_processor, tokenizer, video_processor, **kwargs)
|
| 136 |
+
self.image_token = "<|media_placeholder|>" if not hasattr(tokenizer, "image_token") else tokenizer.image_token
|
| 137 |
+
self.video_token = "<|media_placeholder|>" if not hasattr(tokenizer, "video_token") else tokenizer.video_token
|
| 138 |
+
|
| 139 |
+
self.image_token_id = (
|
| 140 |
+
tokenizer.image_token_id
|
| 141 |
+
if getattr(tokenizer, "image_token_id", None)
|
| 142 |
+
else tokenizer.convert_tokens_to_ids(self.image_token)
|
| 143 |
+
)
|
| 144 |
+
self.video_token_id = (
|
| 145 |
+
tokenizer.video_token_id
|
| 146 |
+
if getattr(tokenizer, "video_token_id", None)
|
| 147 |
+
else tokenizer.convert_tokens_to_ids(self.video_token)
|
| 148 |
+
)
|
| 149 |
+
self.chat_template = self.tokenizer.chat_template
|
| 150 |
+
self.bos_token = self.tokenizer.bos_token
|
| 151 |
+
self.eos_token = self.tokenizer.eos_token
|
| 152 |
+
self.pad_token = self.tokenizer.pad_token
|
| 153 |
+
self.unk_token = self.tokenizer.unk_token
|
| 154 |
+
|
| 155 |
+
def __call__(
|
| 156 |
+
self,
|
| 157 |
+
images: Optional[ImageInput] = None,
|
| 158 |
+
text: Union[TextInput, PreTokenizedInput, list[TextInput], list[PreTokenizedInput]] = None,
|
| 159 |
+
videos: Optional[VideoInput] = None,
|
| 160 |
+
**kwargs: Unpack[Qwen2_5_VLProcessorKwargs],
|
| 161 |
+
) -> BatchFeature:
|
| 162 |
+
"""
|
| 163 |
+
Main method to prepare for the model one or several sequences(s) and image(s). This method forwards the `text`
|
| 164 |
+
and `kwargs` arguments to Qwen2TokenizerFast's [`~Qwen2TokenizerFast.__call__`] if `text` is not `None` to encode
|
| 165 |
+
the text. To prepare the vision inputs, this method forwards the `vision_infos` and `kwargs` arguments to
|
| 166 |
+
Qwen2VLImageProcessor's [`~Qwen2VLImageProcessor.__call__`] if `vision_infos` is not `None`.
|
| 167 |
+
|
| 168 |
+
Args:
|
| 169 |
+
images (`PIL.Image.Image`, `np.ndarray`, `torch.Tensor`, `list[PIL.Image.Image]`, `list[np.ndarray]`, `list[torch.Tensor]`):
|
| 170 |
+
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
|
| 171 |
+
tensor. Both channels-first and channels-last formats are supported.
|
| 172 |
+
text (`str`, `list[str]`, `list[list[str]]`):
|
| 173 |
+
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
|
| 174 |
+
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
|
| 175 |
+
`is_split_into_words=True` (to lift the ambiguity with a batch of sequences).
|
| 176 |
+
videos (`np.ndarray`, `torch.Tensor`, `list[np.ndarray]`, `list[torch.Tensor]`):
|
| 177 |
+
The image or batch of videos to be prepared. Each video can be a 4D NumPy array or PyTorch
|
| 178 |
+
tensor, or a nested list of 3D frames. Both channels-first and channels-last formats are supported.
|
| 179 |
+
return_tensors (`str` or [`~utils.TensorType`], *optional*):
|
| 180 |
+
If set, will return tensors of a particular framework. Acceptable values are:
|
| 181 |
+
- `'pt'`: Return PyTorch `torch.Tensor` objects.
|
| 182 |
+
- `'np'`: Return NumPy `np.ndarray` objects.
|
| 183 |
+
|
| 184 |
+
Returns:
|
| 185 |
+
[`BatchFeature`]: A [`BatchFeature`] with the following fields:
|
| 186 |
+
|
| 187 |
+
- **input_ids** -- List of token ids to be fed to a model. Returned when `text` is not `None`.
|
| 188 |
+
- **attention_mask** -- List of indices specifying which tokens should be attended to by the model (when
|
| 189 |
+
`return_attention_mask=True` or if *"attention_mask"* is in `self.model_input_names` and if `text` is not
|
| 190 |
+
`None`).
|
| 191 |
+
- **pixel_values** -- Pixel values to be fed to a model. Returned when `images` is not `None`.
|
| 192 |
+
- **pixel_values_videos** -- Pixel values of videos to be fed to a model. Returned when `videos` is not `None`.
|
| 193 |
+
- **image_grid_thw** -- List of image 3D grid in LLM. Returned when `images` is not `None`.
|
| 194 |
+
- **video_grid_thw** -- List of video 3D grid in LLM. Returned when `videos` is not `None`.
|
| 195 |
+
- **second_per_grid_ts** -- List of video seconds per time grid. Returned when `videos` is not `None`.
|
| 196 |
+
"""
|
| 197 |
+
output_kwargs = self._merge_kwargs(
|
| 198 |
+
Qwen2_5_VLProcessorKwargs,
|
| 199 |
+
tokenizer_init_kwargs=self.tokenizer.init_kwargs,
|
| 200 |
+
**kwargs,
|
| 201 |
+
)
|
| 202 |
+
|
| 203 |
+
image_inputs = videos_inputs = {}
|
| 204 |
+
if images is not None:
|
| 205 |
+
image_inputs = self.image_processor(images=images, **output_kwargs["images_kwargs"])
|
| 206 |
+
image_grid_thw = image_inputs["image_grid_thw"]
|
| 207 |
+
|
| 208 |
+
if videos is not None:
|
| 209 |
+
fps = output_kwargs["videos_kwargs"].get("fps", 2.0)
|
| 210 |
+
videos_inputs = self.video_processor(videos=videos, **output_kwargs["videos_kwargs"])
|
| 211 |
+
video_grid_thw = videos_inputs["video_grid_thw"]
|
| 212 |
+
|
| 213 |
+
if isinstance(fps, (int, float)):
|
| 214 |
+
second_per_grid_ts = [self.video_processor.temporal_patch_size / fps] * len(video_grid_thw)
|
| 215 |
+
elif hasattr(fps, "__len__") and len(fps) == len(video_grid_thw):
|
| 216 |
+
second_per_grid_ts = [self.video_processor.temporal_patch_size / tmp for tmp in fps]
|
| 217 |
+
else:
|
| 218 |
+
raise ValueError(
|
| 219 |
+
f"The length of fps ({len(fps) if hasattr(fps, '__len__') else fps}) must be equal to the length of video_grid_thw ({len(video_grid_thw)}) or fps should be a single number."
|
| 220 |
+
)
|
| 221 |
+
videos_inputs.update({"second_per_grid_ts": second_per_grid_ts})
|
| 222 |
+
|
| 223 |
+
if not isinstance(text, list):
|
| 224 |
+
text = [text]
|
| 225 |
+
|
| 226 |
+
text = text.copy() # below lines change text in-place
|
| 227 |
+
if images is not None:
|
| 228 |
+
merge_length = self.image_processor.merge_size**2
|
| 229 |
+
index = 0
|
| 230 |
+
for i in range(len(text)):
|
| 231 |
+
while self.image_token in text[i]:
|
| 232 |
+
num_image_tokens = image_grid_thw[index].prod() // merge_length
|
| 233 |
+
text[i] = text[i].replace(self.image_token, '<|temp_placeholder|>' * num_image_tokens, 1)
|
| 234 |
+
index += 1
|
| 235 |
+
text[i] = text[i].replace('<|temp_placeholder|>', self.image_token)
|
| 236 |
+
|
| 237 |
+
if videos is not None:
|
| 238 |
+
merge_length = self.video_processor.merge_size**2
|
| 239 |
+
index = 0
|
| 240 |
+
for i in range(len(text)):
|
| 241 |
+
while self.video_token in text[i]:
|
| 242 |
+
num_video_tokens = video_grid_thw[index].prod() // merge_length
|
| 243 |
+
text[i] = text[i].replace(self.video_token, '<|temp_placeholder|>' * num_video_tokens, 1)
|
| 244 |
+
index += 1
|
| 245 |
+
text[i] = text[i].replace('<|temp_placeholder|>', self.video_token)
|
| 246 |
+
|
| 247 |
+
return_tensors = output_kwargs["text_kwargs"].pop("return_tensors", None)
|
| 248 |
+
return_mm_token_type_ids = output_kwargs["text_kwargs"].pop("return_mm_token_type_ids", None)
|
| 249 |
+
# from IPython import embed; embed()
|
| 250 |
+
text_inputs = self.tokenizer(text, **output_kwargs["text_kwargs"])
|
| 251 |
+
self._check_special_mm_tokens(text, text_inputs, modalities=["image", "video"])
|
| 252 |
+
|
| 253 |
+
if return_mm_token_type_ids:
|
| 254 |
+
array_ids = np.array(text_inputs["input_ids"])
|
| 255 |
+
mm_token_type_ids = np.zeros_like(text_inputs["input_ids"])
|
| 256 |
+
mm_token_type_ids[array_ids == self.image_token_id] = 1
|
| 257 |
+
text_inputs["mm_token_type_ids"] = mm_token_type_ids.tolist()
|
| 258 |
+
|
| 259 |
+
return BatchFeature(data={**text_inputs, **image_inputs, **videos_inputs}, tensor_type=return_tensors)
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
# @property
|
| 263 |
+
# def model_input_names(self):
|
| 264 |
+
# tokenizer_input_names = self.tokenizer.model_input_names
|
| 265 |
+
# image_processor_input_names = self.image_processor.model_input_names
|
| 266 |
+
# names_from_processor = list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))
|
| 267 |
+
# return names_from_processor + ["second_per_grid_ts"]
|
| 268 |
+
|
| 269 |
+
|
| 270 |
+
__all__ = ["OpenCUAProcessor"]
|
tiktoken.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2b1b8dfb5cc5f024bafc373121c6aba3f66f9a5a0269e243470a1de16a33186
|
| 3 |
+
size 2561218
|
tokenization_opencua.py
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import tiktoken
|
| 3 |
+
|
| 4 |
+
from logging import getLogger
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
from typing import (
|
| 7 |
+
cast,
|
| 8 |
+
Tuple,
|
| 9 |
+
Dict,
|
| 10 |
+
Iterator,
|
| 11 |
+
List,
|
| 12 |
+
Union,
|
| 13 |
+
Optional,
|
| 14 |
+
)
|
| 15 |
+
from shutil import copyfile
|
| 16 |
+
from tiktoken.load import load_tiktoken_bpe
|
| 17 |
+
from tokenizers import AddedToken
|
| 18 |
+
from transformers.tokenization_utils import PreTrainedTokenizer
|
| 19 |
+
from transformers.models.gpt2.tokenization_gpt2 import bytes_to_unicode
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
logger = getLogger(__name__)
|
| 24 |
+
VOCAB_FILES_NAMES = {"vocab_file": "tiktoken.model"}
|
| 25 |
+
|
| 26 |
+
class TikTokenTokenizer(PreTrainedTokenizer):
|
| 27 |
+
"""
|
| 28 |
+
Tokenizing and encoding/decoding text using the Tiktoken tokenizer. See megatron/tokenizer/tiktoken_tokenizer.py.
|
| 29 |
+
|
| 30 |
+
This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
|
| 31 |
+
this superclass for more information regarding those methods.
|
| 32 |
+
|
| 33 |
+
Args:
|
| 34 |
+
vocab_file (`str`):
|
| 35 |
+
The path to the Tiktoken model file.
|
| 36 |
+
bos_token (`str` or `tokenizers.AddedToken`, *optional*, defaults to `"<|begin_of_text|>",`):
|
| 37 |
+
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.
|
| 38 |
+
eos_token (`str` or `tokenizers.AddedToken`, *optional*, defaults to `"<|end_of_text|>"`):
|
| 39 |
+
The end of sequence token.
|
| 40 |
+
unk_token (`str` or `tokenizers.AddedToken`, *optional*, defaults to `"<|reserved_special_token_249|>"`):
|
| 41 |
+
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
|
| 42 |
+
token instead. The second to last item in special_tokens.
|
| 43 |
+
pad_token (`str` or `tokenizers.AddedToken`, *optional*, defaults to `"<|reserved_special_token_250|>"`):
|
| 44 |
+
The token used for padding, for example when batching sequences of different lengths.
|
| 45 |
+
additional_special_tokens (list of `str`, *optional*):
|
| 46 |
+
A tuple or a list of additional tokens, which will be marked as `special`, meaning that they will be
|
| 47 |
+
skipped when decoding if `skip_special_tokens` is set to `True`.
|
| 48 |
+
"""
|
| 49 |
+
|
| 50 |
+
vocab_files_names = VOCAB_FILES_NAMES
|
| 51 |
+
|
| 52 |
+
model_input_names = ["input_ids", "attention_mask"]
|
| 53 |
+
|
| 54 |
+
special_tokens: Dict[str, int]
|
| 55 |
+
|
| 56 |
+
num_reserved_special_tokens = 256
|
| 57 |
+
|
| 58 |
+
pat_str = "|".join(
|
| 59 |
+
[
|
| 60 |
+
r"""[\p{Han}]+""",
|
| 61 |
+
r"""[^\r\n\p{L}\p{N}]?[\p{Lu}\p{Lt}\p{Lm}\p{Lo}\p{M}&&[^\p{Han}]]*[\p{Ll}\p{Lm}\p{Lo}\p{M}&&[^\p{Han}]]+(?i:'s|'t|'re|'ve|'m|'ll|'d)?""",
|
| 62 |
+
r"""[^\r\n\p{L}\p{N}]?[\p{Lu}\p{Lt}\p{Lm}\p{Lo}\p{M}&&[^\p{Han}]]+[\p{Ll}\p{Lm}\p{Lo}\p{M}&&[^\p{Han}]]*(?i:'s|'t|'re|'ve|'m|'ll|'d)?""",
|
| 63 |
+
r"""\p{N}{1,3}""",
|
| 64 |
+
r""" ?[^\s\p{L}\p{N}]+[\r\n]*""",
|
| 65 |
+
r"""\s*[\r\n]+""",
|
| 66 |
+
r"""\s+(?!\S)""",
|
| 67 |
+
r"""\s+""",
|
| 68 |
+
]
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
def __init__(
|
| 72 |
+
self,
|
| 73 |
+
vocab_file,
|
| 74 |
+
bos_token: Union[str, AddedToken]="[BOS]",
|
| 75 |
+
eos_token: Union[str, AddedToken]="[EOS]",
|
| 76 |
+
unk_token: Union[str, AddedToken, None]=None,
|
| 77 |
+
pad_token: Union[str, AddedToken, None]=None,
|
| 78 |
+
additional_special_tokens: List[str]=None,
|
| 79 |
+
added_tokens_decoder: Optional[dict] = None,
|
| 80 |
+
**kwargs,
|
| 81 |
+
):
|
| 82 |
+
assert os.path.isfile(vocab_file), vocab_file
|
| 83 |
+
|
| 84 |
+
if additional_special_tokens is None:
|
| 85 |
+
# dumping mode
|
| 86 |
+
used_special_tokens = [
|
| 87 |
+
"<|im_end|>",
|
| 88 |
+
"<|im_user|>",
|
| 89 |
+
"<|im_assistant|>",
|
| 90 |
+
"<|reserved_token_0|>",
|
| 91 |
+
"<|start_header_id|>",
|
| 92 |
+
"<|end_header_id|>",
|
| 93 |
+
"<|reserved_token_1|>",
|
| 94 |
+
"[EOT]",
|
| 95 |
+
"<|im_system|>",
|
| 96 |
+
"<|reserved_token_2|>",
|
| 97 |
+
"<|reserved_token_3|>",
|
| 98 |
+
"<|reserved_token_4|>",
|
| 99 |
+
"<|reserved_token_5|>",
|
| 100 |
+
"<|reserved_token_6|>",
|
| 101 |
+
"<|reserved_token_7|>",
|
| 102 |
+
"<|im_middle|>",
|
| 103 |
+
"<|media_begin|>",
|
| 104 |
+
"<|media_content|>",
|
| 105 |
+
"<|media_end|>",
|
| 106 |
+
"<|media_placeholder|>",
|
| 107 |
+
]
|
| 108 |
+
used_reserved_tokens = 8
|
| 109 |
+
last_reserved_token_id = self.num_reserved_special_tokens - 4 - len(used_special_tokens) + used_reserved_tokens - 1
|
| 110 |
+
additional_special_tokens = used_special_tokens + [
|
| 111 |
+
f"<|reserved_token_{i}|>"
|
| 112 |
+
for i in range(used_reserved_tokens, last_reserved_token_id + 1)
|
| 113 |
+
]
|
| 114 |
+
# num_reserved_special_tokens = additional_special_tokens + BOS + EOS + unk_token + pad_token
|
| 115 |
+
assert len(additional_special_tokens) + 4 == self.num_reserved_special_tokens, f"additional_special_tokens num: {len(additional_special_tokens)} is not correct"
|
| 116 |
+
# we assume that the instance is under initialization and unk_token and pad_token should be automatically inferred
|
| 117 |
+
if unk_token is not None:
|
| 118 |
+
raise ValueError("unk_token should not be set in dumping mode when additional_special_tokens is None")
|
| 119 |
+
if pad_token is not None:
|
| 120 |
+
raise ValueError("pad_token should not be set in dumping mode when additional_special_tokens is None")
|
| 121 |
+
# last two reserved tokens
|
| 122 |
+
unk_token = f"[UNK]"
|
| 123 |
+
pad_token = f"[PAD]"
|
| 124 |
+
|
| 125 |
+
logger.info(f"adding unk_token: {unk_token} and pad_token: {pad_token}")
|
| 126 |
+
self.additional_special_tokens = additional_special_tokens
|
| 127 |
+
special_tokens = [str(bos_token), str(eos_token)] + additional_special_tokens + [str(unk_token), str(pad_token)]
|
| 128 |
+
|
| 129 |
+
self.vocab_file = vocab_file
|
| 130 |
+
mergeable_ranks = load_tiktoken_bpe(vocab_file)
|
| 131 |
+
num_base_tokens = len(mergeable_ranks)
|
| 132 |
+
self.special_tokens = {
|
| 133 |
+
token: num_base_tokens + i for i, token in enumerate(special_tokens)
|
| 134 |
+
}
|
| 135 |
+
else:
|
| 136 |
+
self.additional_special_tokens = additional_special_tokens
|
| 137 |
+
special_tokens_mapping = {
|
| 138 |
+
i: added_tokens_decoder[i].content for i in added_tokens_decoder
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
self.vocab_file = vocab_file
|
| 142 |
+
mergeable_ranks = load_tiktoken_bpe(vocab_file)
|
| 143 |
+
num_base_tokens = len(mergeable_ranks)
|
| 144 |
+
self.special_tokens = {
|
| 145 |
+
special_tokens_mapping.get(i, f"<|reserved_token_{i}|>"): i
|
| 146 |
+
for i in range(
|
| 147 |
+
num_base_tokens, num_base_tokens + self.num_reserved_special_tokens + 2
|
| 148 |
+
)
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
self.model = tiktoken.Encoding(
|
| 154 |
+
name=Path(vocab_file).name,
|
| 155 |
+
pat_str=self.pat_str,
|
| 156 |
+
mergeable_ranks=mergeable_ranks,
|
| 157 |
+
special_tokens=self.special_tokens,
|
| 158 |
+
)
|
| 159 |
+
logger.info(f"Reloaded tiktoken model from {vocab_file}")
|
| 160 |
+
|
| 161 |
+
self.n_words: int = self.model.n_vocab
|
| 162 |
+
# BOS / EOS token IDs
|
| 163 |
+
self.bos_id: int = self.special_tokens[str(bos_token)]
|
| 164 |
+
self.eos_id: int = self.special_tokens[str(eos_token)]
|
| 165 |
+
|
| 166 |
+
logger.info(
|
| 167 |
+
f"#words: {self.n_words} - BOS ID: {self.bos_id} - EOS ID: {self.eos_id}"
|
| 168 |
+
)
|
| 169 |
+
|
| 170 |
+
self.pad_id: int = self.special_tokens[str(pad_token)]
|
| 171 |
+
self.unk_id: int = self.special_tokens[str(unk_token)]
|
| 172 |
+
self.byte_encoder = bytes_to_unicode()
|
| 173 |
+
self.byte_decoder = {v: k for k, v in self.byte_encoder.items()}
|
| 174 |
+
|
| 175 |
+
self.decoder = {}
|
| 176 |
+
for i in range(self.n_words):
|
| 177 |
+
# Taken from https://gist.github.com/xenova/a452a6474428de0182b17605a98631ee
|
| 178 |
+
decoding = ''.join([
|
| 179 |
+
self.byte_encoder[ord(char)] for char in
|
| 180 |
+
self.model.decode_single_token_bytes(i).decode('latin-1')
|
| 181 |
+
])
|
| 182 |
+
self.decoder[i] = decoding
|
| 183 |
+
|
| 184 |
+
self.encoder = {}
|
| 185 |
+
for i in range(self.n_words):
|
| 186 |
+
if i in self.decoder:
|
| 187 |
+
self.encoder[self.decoder[i]] = i
|
| 188 |
+
|
| 189 |
+
super().__init__(
|
| 190 |
+
bos_token=bos_token,
|
| 191 |
+
eos_token=eos_token,
|
| 192 |
+
unk_token=unk_token,
|
| 193 |
+
pad_token=pad_token,
|
| 194 |
+
additional_special_tokens=self.additional_special_tokens,
|
| 195 |
+
**kwargs,
|
| 196 |
+
)
|
| 197 |
+
self.all_special_ids_set = set(self.all_special_ids)
|
| 198 |
+
|
| 199 |
+
def encode(
|
| 200 |
+
self,
|
| 201 |
+
text: str,
|
| 202 |
+
allow_special_tokens = True,
|
| 203 |
+
**kwargs
|
| 204 |
+
) -> List[int]:
|
| 205 |
+
"""
|
| 206 |
+
Encodes a string into a list of token IDs.
|
| 207 |
+
|
| 208 |
+
Args:
|
| 209 |
+
text (str): The input string to be encoded.
|
| 210 |
+
|
| 211 |
+
Returns:
|
| 212 |
+
list[int]: A list of token IDs.
|
| 213 |
+
"""
|
| 214 |
+
# If there are other args, we should call super().encode because there are a lot of code
|
| 215 |
+
# to handle those args. supper().encode finally will call _tokenize and _convert_token_to_id.
|
| 216 |
+
# NOTE: our encode method is not compatible with the super().encode method,
|
| 217 |
+
# e.g. split_special_tokens' default is True in our encode method.
|
| 218 |
+
if len(kwargs) > 0:
|
| 219 |
+
logger.warning( f"Calling super().encode with {kwargs}" )
|
| 220 |
+
return super().encode(text, **kwargs)
|
| 221 |
+
|
| 222 |
+
assert type(text) is str
|
| 223 |
+
|
| 224 |
+
# The tiktoken tokenizer can handle <=400k chars without
|
| 225 |
+
# pyo3_runtime.PanicException.
|
| 226 |
+
TIKTOKEN_MAX_ENCODE_CHARS = 400_000
|
| 227 |
+
|
| 228 |
+
# https://github.com/openai/tiktoken/issues/195
|
| 229 |
+
# Here we iterate over subsequences and split if we exceed the limit
|
| 230 |
+
# of max consecutive non-whitespace or whitespace characters.
|
| 231 |
+
MAX_NO_WHITESPACES_CHARS = 25_000
|
| 232 |
+
|
| 233 |
+
texts = self.pre_tokenizer_process(text)
|
| 234 |
+
|
| 235 |
+
all_substrs = []
|
| 236 |
+
for text in texts:
|
| 237 |
+
substrs = (
|
| 238 |
+
substr
|
| 239 |
+
for i in range(0, len(text), TIKTOKEN_MAX_ENCODE_CHARS)
|
| 240 |
+
for substr in self._split_whitespaces_or_nonwhitespaces(
|
| 241 |
+
text[i: i + TIKTOKEN_MAX_ENCODE_CHARS], MAX_NO_WHITESPACES_CHARS
|
| 242 |
+
)
|
| 243 |
+
)
|
| 244 |
+
all_substrs.extend(substrs)
|
| 245 |
+
|
| 246 |
+
t: List[int] = []
|
| 247 |
+
for substr in all_substrs:
|
| 248 |
+
if allow_special_tokens:
|
| 249 |
+
t.extend(
|
| 250 |
+
self.model.encode(
|
| 251 |
+
substr,
|
| 252 |
+
allowed_special="all",
|
| 253 |
+
)
|
| 254 |
+
)
|
| 255 |
+
else:
|
| 256 |
+
t.extend(
|
| 257 |
+
self.model.encode(
|
| 258 |
+
substr,
|
| 259 |
+
disallowed_special=(),
|
| 260 |
+
)
|
| 261 |
+
)
|
| 262 |
+
|
| 263 |
+
return t
|
| 264 |
+
|
| 265 |
+
def decode(
|
| 266 |
+
self,
|
| 267 |
+
token_ids: Union[int, List[int]],
|
| 268 |
+
**kwargs
|
| 269 |
+
) -> str:
|
| 270 |
+
"""
|
| 271 |
+
Decodes a list of token IDs into a string.
|
| 272 |
+
|
| 273 |
+
Args:
|
| 274 |
+
token_ids (List[int]): The list of token IDs to be decoded.
|
| 275 |
+
|
| 276 |
+
Returns:
|
| 277 |
+
str: The decoded string.
|
| 278 |
+
"""
|
| 279 |
+
# If there are other args, we should call super().decode because there are a lot of code
|
| 280 |
+
# to handle those args. supper().encode finally will call convert_tokens_to_string and _convert_id_to_token.
|
| 281 |
+
if len(kwargs) > 0:
|
| 282 |
+
return super().decode(token_ids, **kwargs)
|
| 283 |
+
|
| 284 |
+
if type(token_ids) is int:
|
| 285 |
+
token_ids = [token_ids]
|
| 286 |
+
|
| 287 |
+
return self.model.decode(cast(List[int], token_ids))
|
| 288 |
+
|
| 289 |
+
@staticmethod
|
| 290 |
+
def _split_whitespaces_or_nonwhitespaces(
|
| 291 |
+
s: str, max_consecutive_slice_len: int
|
| 292 |
+
) -> Iterator[str]:
|
| 293 |
+
"""
|
| 294 |
+
Splits the string `s` so that each substring contains no more than `max_consecutive_slice_len`
|
| 295 |
+
consecutive whitespaces or consecutive non-whitespaces.
|
| 296 |
+
"""
|
| 297 |
+
current_slice_len = 0
|
| 298 |
+
current_slice_is_space = s[0].isspace() if len(s) > 0 else False
|
| 299 |
+
slice_start = 0
|
| 300 |
+
|
| 301 |
+
for i in range(len(s)):
|
| 302 |
+
is_now_space = s[i].isspace()
|
| 303 |
+
|
| 304 |
+
if current_slice_is_space ^ is_now_space:
|
| 305 |
+
current_slice_len = 1
|
| 306 |
+
current_slice_is_space = is_now_space
|
| 307 |
+
else:
|
| 308 |
+
current_slice_len += 1
|
| 309 |
+
if current_slice_len > max_consecutive_slice_len:
|
| 310 |
+
yield s[slice_start:i]
|
| 311 |
+
slice_start = i
|
| 312 |
+
current_slice_len = 1
|
| 313 |
+
yield s[slice_start:]
|
| 314 |
+
|
| 315 |
+
def pre_tokenizer_process(self, text: str) -> List[str]:
|
| 316 |
+
"""
|
| 317 |
+
pre-tokenizes the input text into a list of tokens.
|
| 318 |
+
This method is used to split the input text into smaller chunks for internal processing.
|
| 319 |
+
"""
|
| 320 |
+
return [text]
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
""" ----- Below are the abstract methods required by PreTrainedTokenizer ----- """
|
| 324 |
+
@property
|
| 325 |
+
def vocab_size(self) -> int:
|
| 326 |
+
return self.n_words
|
| 327 |
+
|
| 328 |
+
def get_vocab(self) -> Dict[str, int]:
|
| 329 |
+
return self.encoder
|
| 330 |
+
|
| 331 |
+
def _tokenize(self, text: str, **kwargs) -> List[str]:
|
| 332 |
+
return [
|
| 333 |
+
self.decoder[t]
|
| 334 |
+
for t in self.encode(text)
|
| 335 |
+
]
|
| 336 |
+
|
| 337 |
+
def _convert_token_to_id(self, token: str) -> int:
|
| 338 |
+
return self.encoder.get(token, self.unk_id)
|
| 339 |
+
|
| 340 |
+
def _convert_id_to_token(self, index: int) -> str:
|
| 341 |
+
return self.decoder.get(index)
|
| 342 |
+
|
| 343 |
+
@staticmethod
|
| 344 |
+
def clean_up_tokenization(out_string: str) -> str:
|
| 345 |
+
return out_string
|
| 346 |
+
|
| 347 |
+
def convert_tokens_to_string(self, tokens: List[str]) -> str:
|
| 348 |
+
text = ''.join(tokens)
|
| 349 |
+
text = bytearray([self.byte_decoder[c] for c in text]).decode('utf-8', 'replace')
|
| 350 |
+
return text
|
| 351 |
+
|
| 352 |
+
def save_vocabulary(self, save_directory: str, filename_prefix: Optional[str] = None) -> Tuple[str]:
|
| 353 |
+
if not os.path.isdir(save_directory):
|
| 354 |
+
raise ValueError(f"vocabulary path ({save_directory}) should be a directory")
|
| 355 |
+
out_vocab_file = os.path.join(
|
| 356 |
+
save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
|
| 357 |
+
)
|
| 358 |
+
|
| 359 |
+
if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file) and os.path.isfile(self.vocab_file):
|
| 360 |
+
copyfile(self.vocab_file, out_vocab_file)
|
| 361 |
+
|
| 362 |
+
return (out_vocab_file,)
|
| 363 |
+
|
| 364 |
+
|
| 365 |
+
class TikTokenV3(TikTokenTokenizer):
|
| 366 |
+
num_reserved_special_tokens = 293 + 128
|
| 367 |
+
pat_str = "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+"
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"151643": {
|
| 4 |
+
"content": "[BOS]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"151644": {
|
| 12 |
+
"content": "[EOS]",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"151645": {
|
| 20 |
+
"content": "<|im_end|>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"151646": {
|
| 28 |
+
"content": "<|im_user|>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"151647": {
|
| 36 |
+
"content": "<|im_assistant|>",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
},
|
| 43 |
+
"151648": {
|
| 44 |
+
"content": "<|reserved_token_0|>",
|
| 45 |
+
"lstrip": false,
|
| 46 |
+
"normalized": false,
|
| 47 |
+
"rstrip": false,
|
| 48 |
+
"single_word": false,
|
| 49 |
+
"special": true
|
| 50 |
+
},
|
| 51 |
+
"151649": {
|
| 52 |
+
"content": "<|start_header_id|>",
|
| 53 |
+
"lstrip": false,
|
| 54 |
+
"normalized": false,
|
| 55 |
+
"rstrip": false,
|
| 56 |
+
"single_word": false,
|
| 57 |
+
"special": true
|
| 58 |
+
},
|
| 59 |
+
"151650": {
|
| 60 |
+
"content": "<|end_header_id|>",
|
| 61 |
+
"lstrip": false,
|
| 62 |
+
"normalized": false,
|
| 63 |
+
"rstrip": false,
|
| 64 |
+
"single_word": false,
|
| 65 |
+
"special": true
|
| 66 |
+
},
|
| 67 |
+
"151651": {
|
| 68 |
+
"content": "<|reserved_token_1|>",
|
| 69 |
+
"lstrip": false,
|
| 70 |
+
"normalized": false,
|
| 71 |
+
"rstrip": false,
|
| 72 |
+
"single_word": false,
|
| 73 |
+
"special": true
|
| 74 |
+
},
|
| 75 |
+
"151652": {
|
| 76 |
+
"content": "[EOT]",
|
| 77 |
+
"lstrip": false,
|
| 78 |
+
"normalized": false,
|
| 79 |
+
"rstrip": false,
|
| 80 |
+
"single_word": false,
|
| 81 |
+
"special": true
|
| 82 |
+
},
|
| 83 |
+
"151653": {
|
| 84 |
+
"content": "<|im_system|>",
|
| 85 |
+
"lstrip": false,
|
| 86 |
+
"normalized": false,
|
| 87 |
+
"rstrip": false,
|
| 88 |
+
"single_word": false,
|
| 89 |
+
"special": true
|
| 90 |
+
},
|
| 91 |
+
"151654": {
|
| 92 |
+
"content": "<|reserved_token_2|>",
|
| 93 |
+
"lstrip": false,
|
| 94 |
+
"normalized": false,
|
| 95 |
+
"rstrip": false,
|
| 96 |
+
"single_word": false,
|
| 97 |
+
"special": true
|
| 98 |
+
},
|
| 99 |
+
"151655": {
|
| 100 |
+
"content": "<|reserved_token_3|>",
|
| 101 |
+
"lstrip": false,
|
| 102 |
+
"normalized": false,
|
| 103 |
+
"rstrip": false,
|
| 104 |
+
"single_word": false,
|
| 105 |
+
"special": true
|
| 106 |
+
},
|
| 107 |
+
"151656": {
|
| 108 |
+
"content": "<|reserved_token_4|>",
|
| 109 |
+
"lstrip": false,
|
| 110 |
+
"normalized": false,
|
| 111 |
+
"rstrip": false,
|
| 112 |
+
"single_word": false,
|
| 113 |
+
"special": true
|
| 114 |
+
},
|
| 115 |
+
"151657": {
|
| 116 |
+
"content": "<|reserved_token_5|>",
|
| 117 |
+
"lstrip": false,
|
| 118 |
+
"normalized": false,
|
| 119 |
+
"rstrip": false,
|
| 120 |
+
"single_word": false,
|
| 121 |
+
"special": true
|
| 122 |
+
},
|
| 123 |
+
"151658": {
|
| 124 |
+
"content": "<|reserved_token_6|>",
|
| 125 |
+
"lstrip": false,
|
| 126 |
+
"normalized": false,
|
| 127 |
+
"rstrip": false,
|
| 128 |
+
"single_word": false,
|
| 129 |
+
"special": true
|
| 130 |
+
},
|
| 131 |
+
"151659": {
|
| 132 |
+
"content": "<|reserved_token_7|>",
|
| 133 |
+
"lstrip": false,
|
| 134 |
+
"normalized": false,
|
| 135 |
+
"rstrip": false,
|
| 136 |
+
"single_word": false,
|
| 137 |
+
"special": true
|
| 138 |
+
},
|
| 139 |
+
"151660": {
|
| 140 |
+
"content": "<|im_middle|>",
|
| 141 |
+
"lstrip": false,
|
| 142 |
+
"normalized": false,
|
| 143 |
+
"rstrip": false,
|
| 144 |
+
"single_word": false,
|
| 145 |
+
"special": true
|
| 146 |
+
},
|
| 147 |
+
"151661": {
|
| 148 |
+
"content": "<|media_begin|>",
|
| 149 |
+
"lstrip": false,
|
| 150 |
+
"normalized": false,
|
| 151 |
+
"rstrip": false,
|
| 152 |
+
"single_word": false,
|
| 153 |
+
"special": true
|
| 154 |
+
},
|
| 155 |
+
"151662": {
|
| 156 |
+
"content": "<|media_content|>",
|
| 157 |
+
"lstrip": false,
|
| 158 |
+
"normalized": false,
|
| 159 |
+
"rstrip": false,
|
| 160 |
+
"single_word": false,
|
| 161 |
+
"special": true
|
| 162 |
+
},
|
| 163 |
+
"151663": {
|
| 164 |
+
"content": "<|media_end|>",
|
| 165 |
+
"lstrip": false,
|
| 166 |
+
"normalized": false,
|
| 167 |
+
"rstrip": false,
|
| 168 |
+
"single_word": false,
|
| 169 |
+
"special": true
|
| 170 |
+
},
|
| 171 |
+
"151664": {
|
| 172 |
+
"content": "<|media_placeholder|>",
|
| 173 |
+
"lstrip": false,
|
| 174 |
+
"normalized": false,
|
| 175 |
+
"rstrip": false,
|
| 176 |
+
"single_word": false,
|
| 177 |
+
"special": true
|
| 178 |
+
},
|
| 179 |
+
"152062": {
|
| 180 |
+
"content": "[UNK]",
|
| 181 |
+
"lstrip": false,
|
| 182 |
+
"normalized": false,
|
| 183 |
+
"rstrip": false,
|
| 184 |
+
"single_word": false,
|
| 185 |
+
"special": true
|
| 186 |
+
},
|
| 187 |
+
"152063": {
|
| 188 |
+
"content": "[PAD]",
|
| 189 |
+
"lstrip": false,
|
| 190 |
+
"normalized": false,
|
| 191 |
+
"rstrip": false,
|
| 192 |
+
"single_word": false,
|
| 193 |
+
"special": true
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
},
|
| 197 |
+
"additional_special_tokens": [
|
| 198 |
+
"<|im_end|>",
|
| 199 |
+
"<|im_user|>",
|
| 200 |
+
"<|im_assistant|>",
|
| 201 |
+
"<|reserved_token_0|>",
|
| 202 |
+
"<|start_header_id|>",
|
| 203 |
+
"<|end_header_id|>",
|
| 204 |
+
"<|reserved_token_1|>",
|
| 205 |
+
"[EOT]",
|
| 206 |
+
"<|im_system|>",
|
| 207 |
+
"<|reserved_token_2|>",
|
| 208 |
+
"<|reserved_token_3|>",
|
| 209 |
+
"<|reserved_token_4|>",
|
| 210 |
+
"<|reserved_token_5|>",
|
| 211 |
+
"<|reserved_token_6|>",
|
| 212 |
+
"<|reserved_token_7|>",
|
| 213 |
+
"<|im_middle|>",
|
| 214 |
+
"<|media_begin|>",
|
| 215 |
+
"<|media_content|>",
|
| 216 |
+
"<|media_end|>",
|
| 217 |
+
"<|media_placeholder|>"
|
| 218 |
+
],
|
| 219 |
+
"bos_token": "[BOS]",
|
| 220 |
+
"clean_up_tokenization_spaces": false,
|
| 221 |
+
"eos_token": "[EOS]",
|
| 222 |
+
"extra_special_tokens": {},
|
| 223 |
+
"chat_template": "{%- for message in messages -%}{%- if loop.first and messages[0]['role'] != 'system' -%}{{'<|im_system|>system<|im_middle|>You are a helpful assistant<|im_end|>'}}{%- endif -%}{%- if message['role'] == 'system' -%}{{'<|im_system|>'}}{%- endif -%}{%- if message['role'] == 'user' -%}{{'<|im_user|>'}}{%- endif -%}{%- if message['role'] == 'assistant' -%}{{'<|im_assistant|>'}}{%- endif -%}{{- message['role'] -}}{{'<|im_middle|>'}}{%- if message['content'] is string -%}{{- message['content'] + '<|im_end|>' -}}{%- else -%}{%- for content in message['content'] -%}{%- if content['type'] == 'image' or 'image' in content or 'image_url' in content -%}{{'<|media_begin|>image<|media_content|><|media_placeholder|><|media_end|>'}}{%- else -%}{{content['text']}}{%- endif -%}{%- endfor -%}{{'<|im_end|>'}}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%}{{'<|im_assistant|>assistant<|im_middle|>'}}{%- endif -%}",
|
| 224 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 225 |
+
"pad_token": "[PAD]",
|
| 226 |
+
"tokenizer_class": "TikTokenV3",
|
| 227 |
+
"unk_token": "[UNK]",
|
| 228 |
+
"auto_map": {
|
| 229 |
+
"AutoTokenizer": [
|
| 230 |
+
"tokenization_opencua.TikTokenV3",
|
| 231 |
+
null
|
| 232 |
+
]
|
| 233 |
+
}
|
| 234 |
+
}
|