Upload 7 files
Browse files- config.json +160 -0
- configuration_phi3_v.py +217 -0
- generation_config.json +8 -0
- model.safetensors +3 -0
- special_tokens_map.json +36 -0
- tokenizer.json +0 -0
- tokenizer_config.json +409 -0
config.json
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/mnt/nvme01/huggingface/models/Microsoft/Phi-3-vision-128k-Instruct",
|
3 |
+
"architectures": [
|
4 |
+
"Phi3VForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"auto_map": {
|
8 |
+
"AutoConfig": "configuration_phi3_v.Phi3VConfig",
|
9 |
+
"AutoModelForCausalLM": "modeling_phi3_v.Phi3VForCausalLM"
|
10 |
+
},
|
11 |
+
"bos_token_id": 1,
|
12 |
+
"embd_layer": {
|
13 |
+
"embedding_cls": "image",
|
14 |
+
"hd_transform_order": "sub_glb",
|
15 |
+
"projection_cls": "mlp",
|
16 |
+
"use_hd_transform": true,
|
17 |
+
"with_learnable_separator": true
|
18 |
+
},
|
19 |
+
"embd_pdrop": 0.0,
|
20 |
+
"eos_token_id": 2,
|
21 |
+
"hidden_act": "silu",
|
22 |
+
"hidden_size": 3072,
|
23 |
+
"img_processor": {
|
24 |
+
"image_dim_out": 1024,
|
25 |
+
"model_name": "openai/clip-vit-large-patch14-336",
|
26 |
+
"name": "clip_vision_model",
|
27 |
+
"num_img_tokens": 144
|
28 |
+
},
|
29 |
+
"initializer_range": 0.02,
|
30 |
+
"intermediate_size": 8192,
|
31 |
+
"max_position_embeddings": 131072,
|
32 |
+
"model_type": "phi3_v",
|
33 |
+
"num_attention_heads": 32,
|
34 |
+
"num_hidden_layers": 32,
|
35 |
+
"num_key_value_heads": 32,
|
36 |
+
"original_max_position_embeddings": 4096,
|
37 |
+
"pad_token_id": 32000,
|
38 |
+
"quantization_config": {
|
39 |
+
"bits": 4,
|
40 |
+
"group_size": 128,
|
41 |
+
"modules_to_not_convert": [
|
42 |
+
"vision_embed_tokens"
|
43 |
+
],
|
44 |
+
"quant_method": "awq",
|
45 |
+
"version": "gemm",
|
46 |
+
"zero_point": true
|
47 |
+
},
|
48 |
+
"resid_pdrop": 0.0,
|
49 |
+
"rms_norm_eps": 1e-05,
|
50 |
+
"rope_scaling": {
|
51 |
+
"long_factor": [
|
52 |
+
1.0299999713897705,
|
53 |
+
1.0499999523162842,
|
54 |
+
1.0499999523162842,
|
55 |
+
1.0799999237060547,
|
56 |
+
1.2299998998641968,
|
57 |
+
1.2299998998641968,
|
58 |
+
1.2999999523162842,
|
59 |
+
1.4499999284744263,
|
60 |
+
1.5999999046325684,
|
61 |
+
1.6499998569488525,
|
62 |
+
1.8999998569488525,
|
63 |
+
2.859999895095825,
|
64 |
+
3.68999981880188,
|
65 |
+
5.419999599456787,
|
66 |
+
5.489999771118164,
|
67 |
+
5.489999771118164,
|
68 |
+
9.09000015258789,
|
69 |
+
11.579999923706055,
|
70 |
+
15.65999984741211,
|
71 |
+
15.769999504089355,
|
72 |
+
15.789999961853027,
|
73 |
+
18.360000610351562,
|
74 |
+
21.989999771118164,
|
75 |
+
23.079999923706055,
|
76 |
+
30.009998321533203,
|
77 |
+
32.35000228881836,
|
78 |
+
32.590003967285156,
|
79 |
+
35.56000518798828,
|
80 |
+
39.95000457763672,
|
81 |
+
53.840003967285156,
|
82 |
+
56.20000457763672,
|
83 |
+
57.95000457763672,
|
84 |
+
59.29000473022461,
|
85 |
+
59.77000427246094,
|
86 |
+
59.920005798339844,
|
87 |
+
61.190006256103516,
|
88 |
+
61.96000671386719,
|
89 |
+
62.50000762939453,
|
90 |
+
63.3700065612793,
|
91 |
+
63.48000717163086,
|
92 |
+
63.48000717163086,
|
93 |
+
63.66000747680664,
|
94 |
+
63.850006103515625,
|
95 |
+
64.08000946044922,
|
96 |
+
64.760009765625,
|
97 |
+
64.80001068115234,
|
98 |
+
64.81001281738281,
|
99 |
+
64.81001281738281
|
100 |
+
],
|
101 |
+
"short_factor": [
|
102 |
+
1.05,
|
103 |
+
1.05,
|
104 |
+
1.05,
|
105 |
+
1.1,
|
106 |
+
1.1,
|
107 |
+
1.1,
|
108 |
+
1.2500000000000002,
|
109 |
+
1.2500000000000002,
|
110 |
+
1.4000000000000004,
|
111 |
+
1.4500000000000004,
|
112 |
+
1.5500000000000005,
|
113 |
+
1.8500000000000008,
|
114 |
+
1.9000000000000008,
|
115 |
+
2.000000000000001,
|
116 |
+
2.000000000000001,
|
117 |
+
2.000000000000001,
|
118 |
+
2.000000000000001,
|
119 |
+
2.000000000000001,
|
120 |
+
2.000000000000001,
|
121 |
+
2.000000000000001,
|
122 |
+
2.000000000000001,
|
123 |
+
2.000000000000001,
|
124 |
+
2.000000000000001,
|
125 |
+
2.000000000000001,
|
126 |
+
2.000000000000001,
|
127 |
+
2.000000000000001,
|
128 |
+
2.000000000000001,
|
129 |
+
2.000000000000001,
|
130 |
+
2.000000000000001,
|
131 |
+
2.000000000000001,
|
132 |
+
2.000000000000001,
|
133 |
+
2.000000000000001,
|
134 |
+
2.1000000000000005,
|
135 |
+
2.1000000000000005,
|
136 |
+
2.2,
|
137 |
+
2.3499999999999996,
|
138 |
+
2.3499999999999996,
|
139 |
+
2.3499999999999996,
|
140 |
+
2.3499999999999996,
|
141 |
+
2.3999999999999995,
|
142 |
+
2.3999999999999995,
|
143 |
+
2.6499999999999986,
|
144 |
+
2.6999999999999984,
|
145 |
+
2.8999999999999977,
|
146 |
+
2.9499999999999975,
|
147 |
+
3.049999999999997,
|
148 |
+
3.049999999999997,
|
149 |
+
3.049999999999997
|
150 |
+
],
|
151 |
+
"type": "su"
|
152 |
+
},
|
153 |
+
"rope_theta": 10000.0,
|
154 |
+
"sliding_window": 131072,
|
155 |
+
"tie_word_embeddings": false,
|
156 |
+
"torch_dtype": "float16",
|
157 |
+
"transformers_version": "4.46.3",
|
158 |
+
"use_cache": true,
|
159 |
+
"vocab_size": 32064
|
160 |
+
}
|
configuration_phi3_v.py
ADDED
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
|
16 |
+
""" Phi-3-V model configuration"""
|
17 |
+
|
18 |
+
|
19 |
+
from transformers.configuration_utils import PretrainedConfig
|
20 |
+
from transformers.utils import logging
|
21 |
+
|
22 |
+
|
23 |
+
logger = logging.get_logger(__name__)
|
24 |
+
|
25 |
+
PHI3V_PRETRAINED_CONFIG_ARCHIVE_MAP = {
|
26 |
+
"microsoft/Phi-3-vision-128k-instruct": "https://huggingface.co/microsoft/Phi-3-vision-128k-instruct/resolve/main/config.json",
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
class Phi3VConfig(PretrainedConfig):
|
31 |
+
r"""
|
32 |
+
This is the configuration class to store the configuration of a [`Phi3VModel`]. It is used to instantiate a Phi-3
|
33 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
34 |
+
defaults will yield a similar configuration to that of the
|
35 |
+
[microsoft/Phi-3-vision-128k-instruct](https://huggingface.co/microsoft/Phi-3-vision-128k-instruct).
|
36 |
+
|
37 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
38 |
+
documentation from [`PretrainedConfig`] for more information.
|
39 |
+
|
40 |
+
Args:
|
41 |
+
vocab_size (`int`, *optional*, defaults to 32064):
|
42 |
+
Vocabulary size of the Phi-3-V model. Defines the number of different tokens that can be represented by the
|
43 |
+
`inputs_ids` passed when calling [`Phi3VModel`].
|
44 |
+
hidden_size (`int`, *optional*, defaults to 3072):
|
45 |
+
Dimension of the hidden representations.
|
46 |
+
intermediate_size (`int`, *optional*, defaults to 8192):
|
47 |
+
Dimension of the MLP representations.
|
48 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
49 |
+
Number of hidden layers in the Transformer decoder.
|
50 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
51 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
52 |
+
num_key_value_heads (`int`, *optional*):
|
53 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
54 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
55 |
+
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
56 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
57 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
58 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
59 |
+
`num_attention_heads`.
|
60 |
+
resid_pdrop (`float`, *optional*, defaults to 0.0):
|
61 |
+
Dropout probability for mlp outputs.
|
62 |
+
embd_pdrop (`int`, *optional*, defaults to 0.0):
|
63 |
+
The dropout ratio for the embeddings.
|
64 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
65 |
+
The dropout ratio after computing the attention scores.
|
66 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
67 |
+
The non-linear activation function (function or string) in the decoder.
|
68 |
+
max_position_embeddings (`int`, *optional*, defaults to 4096):
|
69 |
+
The maximum sequence length that this model might ever be used with.
|
70 |
+
original_max_position_embeddings (`int`, *optional*, defaults to 4096):
|
71 |
+
The maximum sequence length that this model was trained with. This is used to determine the size of the
|
72 |
+
original RoPE embeddings when using long scaling.
|
73 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
74 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
75 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-05):
|
76 |
+
The epsilon value used for the RMSNorm.
|
77 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
78 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
79 |
+
relevant if `config.is_decoder=True`. Whether to tie weight embeddings or not.
|
80 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
81 |
+
Whether to tie weight embeddings
|
82 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
83 |
+
The base period of the RoPE embeddings.
|
84 |
+
rope_scaling (`dict`, *optional*):
|
85 |
+
The scaling strategy for the RoPE embeddings. If `None`, no scaling is applied. If a dictionary, it must
|
86 |
+
contain the following keys: `type`, `short_factor` and `long_factor`. The `type` must be either `su` or `yarn` and
|
87 |
+
the `short_factor` and `long_factor` must be lists of numbers with the same length as the hidden size
|
88 |
+
divided by the number of attention heads divided by 2.
|
89 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
90 |
+
The id of the "beginning-of-sequence" token.
|
91 |
+
eos_token_id (`int`, *optional*, defaults to 32000):
|
92 |
+
The id of the "end-of-sequence" token.
|
93 |
+
pad_token_id (`int`, *optional*, defaults to 32000):
|
94 |
+
The id of the padding token.
|
95 |
+
sliding_window (`int`, *optional*):
|
96 |
+
Sliding window attention window size. If `None`, no sliding window is applied.
|
97 |
+
embd_layer (`str`, *optional*, defaults to `"default"`):
|
98 |
+
The embedding layer to use. Can be either `"default"` or `"image"`. "default" uses the standard embedding for text.
|
99 |
+
|
100 |
+
Example:
|
101 |
+
|
102 |
+
```python
|
103 |
+
>>> from transformers import Phi3VModel, Phi3VConfig
|
104 |
+
|
105 |
+
>>> # Initializing a Phi-3-V style configuration
|
106 |
+
>>> configuration = Phi3Config.from_pretrained("microsoft/Phi-3-vision-128k-instruct")
|
107 |
+
|
108 |
+
>>> # Initializing a model from the configuration
|
109 |
+
>>> model = Phi3VModel(configuration)
|
110 |
+
|
111 |
+
>>> # Accessing the model configuration
|
112 |
+
>>> configuration = model.config
|
113 |
+
```"""
|
114 |
+
|
115 |
+
model_type = "phi3_v"
|
116 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
117 |
+
|
118 |
+
def __init__(
|
119 |
+
self,
|
120 |
+
vocab_size=32064,
|
121 |
+
hidden_size=3072,
|
122 |
+
intermediate_size=8192,
|
123 |
+
num_hidden_layers=32,
|
124 |
+
num_attention_heads=32,
|
125 |
+
num_key_value_heads=None,
|
126 |
+
resid_pdrop=0.0,
|
127 |
+
embd_pdrop=0.0,
|
128 |
+
attention_dropout=0.0,
|
129 |
+
hidden_act="silu",
|
130 |
+
max_position_embeddings=4096,
|
131 |
+
original_max_position_embeddings=4096,
|
132 |
+
initializer_range=0.02,
|
133 |
+
rms_norm_eps=1e-5,
|
134 |
+
use_cache=True,
|
135 |
+
tie_word_embeddings=False,
|
136 |
+
rope_theta=10000.0,
|
137 |
+
rope_scaling=None,
|
138 |
+
bos_token_id=1,
|
139 |
+
eos_token_id=32000,
|
140 |
+
pad_token_id=32000,
|
141 |
+
sliding_window=None,
|
142 |
+
embd_layer: str = "default",
|
143 |
+
**kwargs,
|
144 |
+
):
|
145 |
+
self.vocab_size = vocab_size
|
146 |
+
self.hidden_size = hidden_size
|
147 |
+
self.intermediate_size = intermediate_size
|
148 |
+
self.num_hidden_layers = num_hidden_layers
|
149 |
+
self.num_attention_heads = num_attention_heads
|
150 |
+
|
151 |
+
if num_key_value_heads is None:
|
152 |
+
num_key_value_heads = num_attention_heads
|
153 |
+
|
154 |
+
self.num_key_value_heads = num_key_value_heads
|
155 |
+
self.resid_pdrop = resid_pdrop
|
156 |
+
self.embd_pdrop = embd_pdrop
|
157 |
+
self.attention_dropout = attention_dropout
|
158 |
+
self.hidden_act = hidden_act
|
159 |
+
self.max_position_embeddings = max_position_embeddings
|
160 |
+
self.original_max_position_embeddings = original_max_position_embeddings
|
161 |
+
self.initializer_range = initializer_range
|
162 |
+
self.rms_norm_eps = rms_norm_eps
|
163 |
+
self.use_cache = use_cache
|
164 |
+
self.rope_theta = rope_theta
|
165 |
+
self.rope_scaling = rope_scaling
|
166 |
+
self._rope_scaling_validation()
|
167 |
+
self.sliding_window = sliding_window
|
168 |
+
self.embd_layer = embd_layer
|
169 |
+
|
170 |
+
|
171 |
+
super().__init__(
|
172 |
+
bos_token_id=bos_token_id,
|
173 |
+
eos_token_id=eos_token_id,
|
174 |
+
pad_token_id=pad_token_id,
|
175 |
+
tie_word_embeddings=tie_word_embeddings,
|
176 |
+
**kwargs,
|
177 |
+
)
|
178 |
+
|
179 |
+
def _rope_scaling_validation(self):
|
180 |
+
"""
|
181 |
+
Validate the `rope_scaling` configuration.
|
182 |
+
"""
|
183 |
+
if self.rope_scaling is None:
|
184 |
+
return
|
185 |
+
|
186 |
+
if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 3:
|
187 |
+
raise ValueError(
|
188 |
+
"`rope_scaling` must be a dictionary with three fields, `type`, `short_factor` and `long_factor`, "
|
189 |
+
f"got {self.rope_scaling}"
|
190 |
+
)
|
191 |
+
rope_scaling_type = self.rope_scaling.get("type", None)
|
192 |
+
rope_scaling_short_factor = self.rope_scaling.get("short_factor", None)
|
193 |
+
rope_scaling_long_factor = self.rope_scaling.get("long_factor", None)
|
194 |
+
if rope_scaling_type is None or rope_scaling_type not in ["su", "yarn"]:
|
195 |
+
raise ValueError(f"`rope_scaling`'s type field must be one of ['su', 'yarn'], got {rope_scaling_type}")
|
196 |
+
if not (
|
197 |
+
isinstance(rope_scaling_short_factor, list)
|
198 |
+
and all(isinstance(x, (int, float)) for x in rope_scaling_short_factor)
|
199 |
+
):
|
200 |
+
raise ValueError(
|
201 |
+
f"`rope_scaling`'s short_factor field must be a list of numbers, got {rope_scaling_short_factor}"
|
202 |
+
)
|
203 |
+
if not len(rope_scaling_short_factor) == self.hidden_size // self.num_attention_heads // 2:
|
204 |
+
raise ValueError(
|
205 |
+
f"`rope_scaling`'s short_factor field must have length {self.hidden_size // self.num_attention_heads // 2}, got {len(rope_scaling_short_factor)}"
|
206 |
+
)
|
207 |
+
if not (
|
208 |
+
isinstance(rope_scaling_long_factor, list)
|
209 |
+
and all(isinstance(x, (int, float)) for x in rope_scaling_long_factor)
|
210 |
+
):
|
211 |
+
raise ValueError(
|
212 |
+
f"`rope_scaling`'s long_factor field must be a list of numbers, got {rope_scaling_long_factor}"
|
213 |
+
)
|
214 |
+
if not len(rope_scaling_long_factor) == self.hidden_size // self.num_attention_heads // 2:
|
215 |
+
raise ValueError(
|
216 |
+
f"`rope_scaling`'s long_factor field must have length {self.hidden_size // self.num_attention_heads // 2}, got {len(rope_scaling_long_factor)}"
|
217 |
+
)
|
generation_config.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"do_sample": true,
|
5 |
+
"eos_token_id": 2,
|
6 |
+
"pad_token_id": 32000,
|
7 |
+
"transformers_version": "4.46.3"
|
8 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:859ed9d7e6e2fc0374d93d65f8dc2c97a8c464fc92ba6434b5f0132f4fc36c69
|
3 |
+
size 2928320296
|
special_tokens_map.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<|system|>",
|
4 |
+
"<|end|>",
|
5 |
+
"<|user|>",
|
6 |
+
"<|end|>"
|
7 |
+
],
|
8 |
+
"bos_token": {
|
9 |
+
"content": "<s>",
|
10 |
+
"lstrip": false,
|
11 |
+
"normalized": false,
|
12 |
+
"rstrip": false,
|
13 |
+
"single_word": false
|
14 |
+
},
|
15 |
+
"eos_token": {
|
16 |
+
"content": "<|endoftext|>",
|
17 |
+
"lstrip": false,
|
18 |
+
"normalized": false,
|
19 |
+
"rstrip": false,
|
20 |
+
"single_word": false
|
21 |
+
},
|
22 |
+
"pad_token": {
|
23 |
+
"content": "<|endoftext|>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false
|
28 |
+
},
|
29 |
+
"unk_token": {
|
30 |
+
"content": "<unk>",
|
31 |
+
"lstrip": false,
|
32 |
+
"normalized": false,
|
33 |
+
"rstrip": false,
|
34 |
+
"single_word": false
|
35 |
+
}
|
36 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,409 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": true,
|
27 |
+
"single_word": false,
|
28 |
+
"special": false
|
29 |
+
},
|
30 |
+
"32000": {
|
31 |
+
"content": "<|endoftext|>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": true
|
37 |
+
},
|
38 |
+
"32001": {
|
39 |
+
"content": "<|assistant|>",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": false,
|
42 |
+
"rstrip": true,
|
43 |
+
"single_word": false,
|
44 |
+
"special": true
|
45 |
+
},
|
46 |
+
"32002": {
|
47 |
+
"content": "<|placeholder1|>",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": false,
|
50 |
+
"rstrip": true,
|
51 |
+
"single_word": false,
|
52 |
+
"special": true
|
53 |
+
},
|
54 |
+
"32003": {
|
55 |
+
"content": "<|placeholder2|>",
|
56 |
+
"lstrip": false,
|
57 |
+
"normalized": false,
|
58 |
+
"rstrip": true,
|
59 |
+
"single_word": false,
|
60 |
+
"special": true
|
61 |
+
},
|
62 |
+
"32004": {
|
63 |
+
"content": "<|placeholder3|>",
|
64 |
+
"lstrip": false,
|
65 |
+
"normalized": false,
|
66 |
+
"rstrip": true,
|
67 |
+
"single_word": false,
|
68 |
+
"special": true
|
69 |
+
},
|
70 |
+
"32005": {
|
71 |
+
"content": "<|placeholder4|>",
|
72 |
+
"lstrip": false,
|
73 |
+
"normalized": false,
|
74 |
+
"rstrip": true,
|
75 |
+
"single_word": false,
|
76 |
+
"special": true
|
77 |
+
},
|
78 |
+
"32006": {
|
79 |
+
"content": "<|system|>",
|
80 |
+
"lstrip": false,
|
81 |
+
"normalized": false,
|
82 |
+
"rstrip": false,
|
83 |
+
"single_word": false,
|
84 |
+
"special": true
|
85 |
+
},
|
86 |
+
"32007": {
|
87 |
+
"content": "<|end|>",
|
88 |
+
"lstrip": false,
|
89 |
+
"normalized": false,
|
90 |
+
"rstrip": false,
|
91 |
+
"single_word": false,
|
92 |
+
"special": true
|
93 |
+
},
|
94 |
+
"32008": {
|
95 |
+
"content": "<|placeholder5|>",
|
96 |
+
"lstrip": false,
|
97 |
+
"normalized": false,
|
98 |
+
"rstrip": true,
|
99 |
+
"single_word": false,
|
100 |
+
"special": true
|
101 |
+
},
|
102 |
+
"32009": {
|
103 |
+
"content": "<|placeholder6|>",
|
104 |
+
"lstrip": false,
|
105 |
+
"normalized": false,
|
106 |
+
"rstrip": true,
|
107 |
+
"single_word": false,
|
108 |
+
"special": true
|
109 |
+
},
|
110 |
+
"32010": {
|
111 |
+
"content": "<|user|>",
|
112 |
+
"lstrip": false,
|
113 |
+
"normalized": false,
|
114 |
+
"rstrip": false,
|
115 |
+
"single_word": false,
|
116 |
+
"special": true
|
117 |
+
},
|
118 |
+
"32011": {
|
119 |
+
"content": "<|placeholder7|>",
|
120 |
+
"lstrip": false,
|
121 |
+
"normalized": false,
|
122 |
+
"rstrip": true,
|
123 |
+
"single_word": false,
|
124 |
+
"special": true
|
125 |
+
},
|
126 |
+
"32012": {
|
127 |
+
"content": "<|placeholder8|>",
|
128 |
+
"lstrip": false,
|
129 |
+
"normalized": false,
|
130 |
+
"rstrip": true,
|
131 |
+
"single_word": false,
|
132 |
+
"special": true
|
133 |
+
},
|
134 |
+
"32013": {
|
135 |
+
"content": "<|placeholder9|>",
|
136 |
+
"lstrip": false,
|
137 |
+
"normalized": false,
|
138 |
+
"rstrip": true,
|
139 |
+
"single_word": false,
|
140 |
+
"special": true
|
141 |
+
},
|
142 |
+
"32014": {
|
143 |
+
"content": "<|placeholder10|>",
|
144 |
+
"lstrip": false,
|
145 |
+
"normalized": false,
|
146 |
+
"rstrip": true,
|
147 |
+
"single_word": false,
|
148 |
+
"special": true
|
149 |
+
},
|
150 |
+
"32015": {
|
151 |
+
"content": "<|placeholder11|>",
|
152 |
+
"lstrip": false,
|
153 |
+
"normalized": false,
|
154 |
+
"rstrip": true,
|
155 |
+
"single_word": false,
|
156 |
+
"special": true
|
157 |
+
},
|
158 |
+
"32016": {
|
159 |
+
"content": "<|placeholder12|>",
|
160 |
+
"lstrip": false,
|
161 |
+
"normalized": false,
|
162 |
+
"rstrip": true,
|
163 |
+
"single_word": false,
|
164 |
+
"special": true
|
165 |
+
},
|
166 |
+
"32017": {
|
167 |
+
"content": "<|placeholder13|>",
|
168 |
+
"lstrip": false,
|
169 |
+
"normalized": false,
|
170 |
+
"rstrip": true,
|
171 |
+
"single_word": false,
|
172 |
+
"special": true
|
173 |
+
},
|
174 |
+
"32018": {
|
175 |
+
"content": "<|placeholder14|>",
|
176 |
+
"lstrip": false,
|
177 |
+
"normalized": false,
|
178 |
+
"rstrip": true,
|
179 |
+
"single_word": false,
|
180 |
+
"special": true
|
181 |
+
},
|
182 |
+
"32019": {
|
183 |
+
"content": "<|placeholder15|>",
|
184 |
+
"lstrip": false,
|
185 |
+
"normalized": false,
|
186 |
+
"rstrip": true,
|
187 |
+
"single_word": false,
|
188 |
+
"special": true
|
189 |
+
},
|
190 |
+
"32020": {
|
191 |
+
"content": "<|placeholder16|>",
|
192 |
+
"lstrip": false,
|
193 |
+
"normalized": false,
|
194 |
+
"rstrip": true,
|
195 |
+
"single_word": false,
|
196 |
+
"special": true
|
197 |
+
},
|
198 |
+
"32021": {
|
199 |
+
"content": "<|placeholder17|>",
|
200 |
+
"lstrip": false,
|
201 |
+
"normalized": false,
|
202 |
+
"rstrip": true,
|
203 |
+
"single_word": false,
|
204 |
+
"special": true
|
205 |
+
},
|
206 |
+
"32022": {
|
207 |
+
"content": "<|placeholder18|>",
|
208 |
+
"lstrip": false,
|
209 |
+
"normalized": false,
|
210 |
+
"rstrip": true,
|
211 |
+
"single_word": false,
|
212 |
+
"special": true
|
213 |
+
},
|
214 |
+
"32023": {
|
215 |
+
"content": "<|placeholder19|>",
|
216 |
+
"lstrip": false,
|
217 |
+
"normalized": false,
|
218 |
+
"rstrip": true,
|
219 |
+
"single_word": false,
|
220 |
+
"special": true
|
221 |
+
},
|
222 |
+
"32024": {
|
223 |
+
"content": "<|placeholder20|>",
|
224 |
+
"lstrip": false,
|
225 |
+
"normalized": false,
|
226 |
+
"rstrip": true,
|
227 |
+
"single_word": false,
|
228 |
+
"special": true
|
229 |
+
},
|
230 |
+
"32025": {
|
231 |
+
"content": "<|placeholder21|>",
|
232 |
+
"lstrip": false,
|
233 |
+
"normalized": false,
|
234 |
+
"rstrip": true,
|
235 |
+
"single_word": false,
|
236 |
+
"special": true
|
237 |
+
},
|
238 |
+
"32026": {
|
239 |
+
"content": "<|placeholder22|>",
|
240 |
+
"lstrip": false,
|
241 |
+
"normalized": false,
|
242 |
+
"rstrip": true,
|
243 |
+
"single_word": false,
|
244 |
+
"special": true
|
245 |
+
},
|
246 |
+
"32027": {
|
247 |
+
"content": "<|placeholder23|>",
|
248 |
+
"lstrip": false,
|
249 |
+
"normalized": false,
|
250 |
+
"rstrip": true,
|
251 |
+
"single_word": false,
|
252 |
+
"special": true
|
253 |
+
},
|
254 |
+
"32028": {
|
255 |
+
"content": "<|placeholder24|>",
|
256 |
+
"lstrip": false,
|
257 |
+
"normalized": false,
|
258 |
+
"rstrip": true,
|
259 |
+
"single_word": false,
|
260 |
+
"special": true
|
261 |
+
},
|
262 |
+
"32029": {
|
263 |
+
"content": "<|placeholder25|>",
|
264 |
+
"lstrip": false,
|
265 |
+
"normalized": false,
|
266 |
+
"rstrip": true,
|
267 |
+
"single_word": false,
|
268 |
+
"special": true
|
269 |
+
},
|
270 |
+
"32030": {
|
271 |
+
"content": "<|placeholder26|>",
|
272 |
+
"lstrip": false,
|
273 |
+
"normalized": false,
|
274 |
+
"rstrip": true,
|
275 |
+
"single_word": false,
|
276 |
+
"special": true
|
277 |
+
},
|
278 |
+
"32031": {
|
279 |
+
"content": "<|placeholder27|>",
|
280 |
+
"lstrip": false,
|
281 |
+
"normalized": false,
|
282 |
+
"rstrip": true,
|
283 |
+
"single_word": false,
|
284 |
+
"special": true
|
285 |
+
},
|
286 |
+
"32032": {
|
287 |
+
"content": "<|placeholder28|>",
|
288 |
+
"lstrip": false,
|
289 |
+
"normalized": false,
|
290 |
+
"rstrip": true,
|
291 |
+
"single_word": false,
|
292 |
+
"special": true
|
293 |
+
},
|
294 |
+
"32033": {
|
295 |
+
"content": "<|placeholder29|>",
|
296 |
+
"lstrip": false,
|
297 |
+
"normalized": false,
|
298 |
+
"rstrip": true,
|
299 |
+
"single_word": false,
|
300 |
+
"special": true
|
301 |
+
},
|
302 |
+
"32034": {
|
303 |
+
"content": "<|placeholder30|>",
|
304 |
+
"lstrip": false,
|
305 |
+
"normalized": false,
|
306 |
+
"rstrip": true,
|
307 |
+
"single_word": false,
|
308 |
+
"special": true
|
309 |
+
},
|
310 |
+
"32035": {
|
311 |
+
"content": "<|placeholder31|>",
|
312 |
+
"lstrip": false,
|
313 |
+
"normalized": false,
|
314 |
+
"rstrip": true,
|
315 |
+
"single_word": false,
|
316 |
+
"special": true
|
317 |
+
},
|
318 |
+
"32036": {
|
319 |
+
"content": "<|placeholder32|>",
|
320 |
+
"lstrip": false,
|
321 |
+
"normalized": false,
|
322 |
+
"rstrip": true,
|
323 |
+
"single_word": false,
|
324 |
+
"special": true
|
325 |
+
},
|
326 |
+
"32037": {
|
327 |
+
"content": "<|placeholder33|>",
|
328 |
+
"lstrip": false,
|
329 |
+
"normalized": false,
|
330 |
+
"rstrip": true,
|
331 |
+
"single_word": false,
|
332 |
+
"special": true
|
333 |
+
},
|
334 |
+
"32038": {
|
335 |
+
"content": "<|placeholder34|>",
|
336 |
+
"lstrip": false,
|
337 |
+
"normalized": false,
|
338 |
+
"rstrip": true,
|
339 |
+
"single_word": false,
|
340 |
+
"special": true
|
341 |
+
},
|
342 |
+
"32039": {
|
343 |
+
"content": "<|placeholder35|>",
|
344 |
+
"lstrip": false,
|
345 |
+
"normalized": false,
|
346 |
+
"rstrip": true,
|
347 |
+
"single_word": false,
|
348 |
+
"special": true
|
349 |
+
},
|
350 |
+
"32040": {
|
351 |
+
"content": "<|placeholder36|>",
|
352 |
+
"lstrip": false,
|
353 |
+
"normalized": false,
|
354 |
+
"rstrip": true,
|
355 |
+
"single_word": false,
|
356 |
+
"special": true
|
357 |
+
},
|
358 |
+
"32041": {
|
359 |
+
"content": "<|placeholder37|>",
|
360 |
+
"lstrip": false,
|
361 |
+
"normalized": false,
|
362 |
+
"rstrip": true,
|
363 |
+
"single_word": false,
|
364 |
+
"special": true
|
365 |
+
},
|
366 |
+
"32042": {
|
367 |
+
"content": "<|placeholder38|>",
|
368 |
+
"lstrip": false,
|
369 |
+
"normalized": false,
|
370 |
+
"rstrip": true,
|
371 |
+
"single_word": false,
|
372 |
+
"special": true
|
373 |
+
},
|
374 |
+
"32043": {
|
375 |
+
"content": "<|placeholder39|>",
|
376 |
+
"lstrip": false,
|
377 |
+
"normalized": false,
|
378 |
+
"rstrip": true,
|
379 |
+
"single_word": false,
|
380 |
+
"special": true
|
381 |
+
},
|
382 |
+
"32044": {
|
383 |
+
"content": "<|image|>",
|
384 |
+
"lstrip": false,
|
385 |
+
"normalized": false,
|
386 |
+
"rstrip": true,
|
387 |
+
"single_word": false,
|
388 |
+
"special": true
|
389 |
+
}
|
390 |
+
},
|
391 |
+
"additional_special_tokens": [
|
392 |
+
"<|system|>",
|
393 |
+
"<|end|>",
|
394 |
+
"<|user|>",
|
395 |
+
"<|end|>"
|
396 |
+
],
|
397 |
+
"bos_token": "<s>",
|
398 |
+
"chat_template": "{% for message in messages %}{{'<|' + message['role'] + '|>' + '\n' + message['content'] + '<|end|>\n' }}{% endfor %}{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}{{- '<|assistant|>\n' -}}{% endif %}",
|
399 |
+
"clean_up_tokenization_spaces": false,
|
400 |
+
"eos_token": "<|endoftext|>",
|
401 |
+
"legacy": false,
|
402 |
+
"model_max_length": 131072,
|
403 |
+
"pad_token": "<|endoftext|>",
|
404 |
+
"padding_side": "right",
|
405 |
+
"sp_model_kwargs": {},
|
406 |
+
"tokenizer_class": "LlamaTokenizer",
|
407 |
+
"unk_token": "<unk>",
|
408 |
+
"use_default_system_prompt": false
|
409 |
+
}
|