vllm.transformers_utils.configs
Modules:
Name | Description |
---|---|
arctic |
Arctic model configuration |
chatglm |
|
cohere2 |
|
dbrx |
Dbrx configuration. |
deepseek_vl2 |
|
eagle |
|
exaone |
Exaone model configuration |
falcon |
Falcon configuration |
jais |
JAIS configuration |
kimi_vl |
|
medusa |
|
minimax_text_01 |
MiniMaxText01 model configuration |
minimax_vl_01 |
MiniMaxVL01 model configuration |
mllama |
|
mlp_speculator |
|
moonvit |
|
mpt |
A HuggingFace-style model configuration. |
nemotron |
Nemotron model configuration |
nemotron_h |
NemotronH model configuration |
nvlm_d |
|
ovis |
|
skyworkr1v |
|
solar |
Solar model configuration |
telechat2 |
Telechat configuration compatible with LlamaConfig. |
ultravox |
|
__all__
module-attribute
¶
__all__ = [
"ChatGLMConfig",
"Cohere2Config",
"DbrxConfig",
"DeepseekVLV2Config",
"MPTConfig",
"RWConfig",
"JAISConfig",
"MedusaConfig",
"EAGLEConfig",
"ExaoneConfig",
"MiniMaxText01Config",
"MiniMaxVL01Config",
"MllamaConfig",
"MLPSpeculatorConfig",
"MoonViTConfig",
"KimiVLConfig",
"NemotronConfig",
"NemotronHConfig",
"NVLM_D_Config",
"OvisConfig",
"SkyworkR1VChatConfig",
"SolarConfig",
"Telechat2Config",
"UltravoxConfig",
]
ChatGLMConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/chatglm.py
apply_query_key_layer_scaling
instance-attribute
¶
apply_residual_connection_post_layernorm
instance-attribute
¶
attention_softmax_in_fp32
instance-attribute
¶
attribute_map
class-attribute
instance-attribute
¶
__init__
¶
__init__(
num_layers=28,
padded_vocab_size=65024,
hidden_size=4096,
ffn_hidden_size=13696,
kv_channels=128,
num_attention_heads=32,
seq_length=2048,
hidden_dropout=0.0,
attention_dropout=0.0,
layernorm_epsilon=1e-05,
rmsnorm=True,
apply_residual_connection_post_layernorm=False,
post_layer_norm=True,
add_bias_linear=False,
add_qkv_bias=False,
interleaved_qkv=False,
bias_dropout_fusion=True,
multi_query_attention=False,
multi_query_group_num=1,
apply_query_key_layer_scaling=True,
attention_softmax_in_fp32=True,
fp32_residual_connection=False,
quantization_bit=0,
pre_seq_len=None,
prefix_projection=False,
**kwargs,
)
Source code in vllm/transformers_utils/configs/chatglm.py
Cohere2Config
¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a [CohereModel
]. It is used to instantiate an Cohere
model according to the specified arguments, defining the model architecture.
Configuration objects inherit from [PretrainedConfig
] and can be used to control the model outputs. Read the
documentation from [PretrainedConfig
] for more information. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CohereForAI/c4ai-command-r-v01 model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vocab_size
|
`int`, *optional*, defaults to 256000
|
Vocabulary size of the Cohere model. Defines the number of different tokens that can be represented by the
|
256000
|
hidden_size
|
`int`, *optional*, defaults to 8192
|
Dimension of the hidden representations. |
8192
|
intermediate_size
|
`int`, *optional*, defaults to 22528
|
Dimension of the MLP representations. |
22528
|
logit_scale
|
`float`, *optional*, defaults to 0.0625
|
The scaling factor for the output logits. |
0.0625
|
num_hidden_layers
|
`int`, *optional*, defaults to 40
|
Number of hidden layers in the Transformer decoder. |
40
|
num_attention_heads
|
`int`, *optional*, defaults to 64
|
Number of attention heads for each attention layer in the Transformer decoder. |
64
|
num_key_value_heads
|
`int`, *optional*
|
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
None
|
hidden_act
|
`str` or `function`, *optional*, defaults to `"silu"`
|
The non-linear activation function (function or string) in the decoder. |
'silu'
|
max_position_embeddings
|
`int`, *optional*, defaults to 8192
|
The maximum sequence length that this model might ever be used with. |
8192
|
initializer_range
|
`float`, *optional*, defaults to 0.02
|
The standard deviation of the truncated_normal_initializer for initializing all weight matrices. |
0.02
|
layer_norm_eps
|
`float`, *optional*, defaults to 1e-05
|
The epsilon used by the layer normalization. |
1e-05
|
use_cache
|
`bool`, *optional*, defaults to `True`
|
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if |
True
|
pad_token_id
|
`int`, *optional*, defaults to 0
|
Padding token id. |
0
|
bos_token_id
|
`int`, *optional*, defaults to 5
|
Beginning of stream token id. |
5
|
eos_token_id
|
`int`, *optional*, defaults to 255001
|
End of stream token id. |
255001
|
tie_word_embeddings
|
`bool`, *optional*, defaults to `True`
|
Whether to tie weight embeddings |
True
|
rope_theta
|
`float`, *optional*, defaults to 10000.0
|
The base period of the RoPE embeddings. |
10000.0
|
rope_scaling
|
`dict`, *optional*
|
Dictionary containing the scaling configuration for the RoPE embeddings. NOTE: if you apply new rope type
and you expect the model to work on longer |
None
|
attention_bias
|
`bool`, defaults to `False`, *optional*, defaults to `False`
|
Whether to use a bias in the query, key, value and output projection layers during self-attention. |
False
|
attention_dropout
|
`float`, *optional*, defaults to 0.0
|
The dropout ratio for the attention probabilities. |
0.0
|
sliding_window
|
`int`, *optional*, defaults to 4096
|
Size of the sliding window attention context. |
4096
|
sliding_window_pattern
|
`int`, *optional*, defaults to 4
|
Pattern for the sliding window attention. |
4
|
cache_implementation
|
`str`, *optional*, defaults to `"hybrid"`
|
the cache type to be used with |
'hybrid'
|
>>> from transformers import Cohere2Model, Cohere2Config
>>> # Initializing a Cohere Nextmodel configuration
>>> configuration = Cohere2Config()
>>> # Initializing a model from the Cohere2 configuration
>>> model = Cohere2Model(configuration) # doctest: +SKIP
>>> # Accessing the model configuration
>>> configuration = model.config # doctest: +SKIP
Source code in vllm/transformers_utils/configs/cohere2.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
__init__
¶
__init__(
vocab_size=256000,
hidden_size=8192,
intermediate_size=22528,
logit_scale=0.0625,
num_hidden_layers=40,
num_attention_heads=64,
num_key_value_heads=None,
hidden_act="silu",
max_position_embeddings=8192,
initializer_range=0.02,
layer_norm_eps=1e-05,
use_cache=True,
pad_token_id=0,
bos_token_id=5,
eos_token_id=255001,
tie_word_embeddings=True,
rope_theta=10000.0,
rope_scaling=None,
attention_bias=False,
attention_dropout=0.0,
sliding_window=4096,
sliding_window_pattern=4,
cache_implementation="hybrid",
**kwargs,
)
Source code in vllm/transformers_utils/configs/cohere2.py
DbrxConfig
¶
Bases: PretrainedConfig
Configuration class for Dbrx.
[DbrxModel
]. It is used to instantiate a Dbrx model according to the
specified arguments, defining the model architecture.
Configuration objects inherit from [PretrainedConfig
] and can be used to control the model outputs. Read the
documentation from [PretrainedConfig
] for more information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d_model
|
`int`, *optional*, defaults to 6144
|
Dimensionality of the embeddings and hidden states. |
2048
|
n_heads
|
`int`, *optional*, defaults to 48
|
Number of attention heads for each attention layer in the Transformer encoder. |
16
|
n_layers
|
`int`, *optional*, defaults to 40
|
Number of hidden layers in the Transformer encoder. |
24
|
max_seq_len
|
`int`, *optional*, defaults to 32768
|
The maximum sequence length of the model. |
2048
|
vocab_size
|
`int`, *optional*, defaults to 100352
|
Vocabulary size of the Dbrx model. Defines the maximum number of different tokens that can be represented by
the |
32000
|
resid_pdrop
|
`float`, *optional*, defaults to 0.0
|
The dropout probability applied to the attention output before combining with residual. |
0.0
|
emb_pdrop
|
`float`, *optional*, defaults to 0.0
|
The dropout probability for the embedding layer. |
0.0
|
attn_config
|
`dict`, *optional*
|
A dictionary used to configure the model's attention module. |
None
|
ffn_config
|
`dict`, *optional*
|
A dictionary used to configure the model's FFN module. |
None
|
use_cache
|
`bool`, *optional*, defaults to `False`
|
Whether or not the model should return the last key/values attentions (not used by all models). |
True
|
initializer_range
|
`float`, *optional*, defaults to 0.02
|
The standard deviation of the truncated_normal_initializer for initializing all weight matrices. |
0.02
|
output_router_logits
|
`bool`, *optional*, defaults to `False`
|
Whether or not the router logits should be returned by the model. Enabling this will also allow the model to output the auxiliary loss. |
False
|
router_aux_loss_coef
|
`float`, *optional*, defaults to 0.001
|
The aux loss factor for the total loss. |
0.05
|
Example:
>>> from transformers import DbrxConfig, DbrxModel
>>> # Initializing a Dbrx configuration
>>> configuration = DbrxConfig()
>>> # Initializing a model (with random weights) from the configuration
>>> model = DbrxModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in vllm/transformers_utils/configs/dbrx.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
attribute_map
class-attribute
instance-attribute
¶
attribute_map = {
"num_attention_heads": "n_heads",
"hidden_size": "d_model",
"num_hidden_layers": "n_layers",
"max_position_embeddings": "max_seq_len",
}
__init__
¶
__init__(
d_model: int = 2048,
n_heads: int = 16,
n_layers: int = 24,
max_seq_len: int = 2048,
vocab_size: int = 32000,
resid_pdrop: float = 0.0,
emb_pdrop: float = 0.0,
attn_config: Optional[DbrxAttentionConfig] = None,
ffn_config: Optional[DbrxFFNConfig] = None,
use_cache: bool = True,
initializer_range: float = 0.02,
output_router_logits: bool = False,
router_aux_loss_coef: float = 0.05,
**kwargs: Any,
)
Source code in vllm/transformers_utils/configs/dbrx.py
DeepseekVLV2Config
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/deepseek_vl2.py
candidate_resolutions
class-attribute
instance-attribute
¶
projector_config
instance-attribute
¶
projector_config: MlpProjectorConfig = MlpProjectorConfig(
**projector_config
)
vision_config
instance-attribute
¶
vision_config: VisionEncoderConfig = VisionEncoderConfig(
**vision_config
)
__init__
¶
__init__(
tile_tag: str = "tile_tag",
global_view_pos: str = "head",
candidate_resolutions: tuple[tuple[int, int]] = (
(384, 384),
),
**kwargs,
)
Source code in vllm/transformers_utils/configs/deepseek_vl2.py
EAGLEConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/eagle.py
__init__
¶
__init__(
model: Union[PretrainedConfig, dict, None] = None,
truncated_vocab_size: Optional[int] = None,
method: Optional[str] = "eagle",
**kwargs,
)
Source code in vllm/transformers_utils/configs/eagle.py
from_pretrained
classmethod
¶
from_pretrained(
pretrained_model_name_or_path: Union[str, PathLike],
**kwargs,
) -> EAGLEConfig
Source code in vllm/transformers_utils/configs/eagle.py
ExaoneConfig
¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a :class:
~transformers.ExaoneModel
. It is used to instantiate a GPT Lingvo model
according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar
configuration to that of the Exaone
Configuration objects inherit from {class}~transformers.PretrainedConfig
and can be used to control the model outputs. Read the documentation from :
class:~transformers.PretrainedConfig
for more information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vocab_size
|
{obj}`int`, `optional`, defaults to 50257
|
Vocabulary size of the GPT Lingvo model. Defines the number of
different tokens that can be represented by the {obj} |
102400
|
hidden_size
|
{obj}`int`, `optional`, defaults to 2048
|
Dimensionality of the encoder layers and the pooler layer. |
2048
|
num_layers
|
{obj}`int`, `optional`, defaults to 24
|
Number of hidden layers in the Transformer encoder. |
32
|
num_attention_heads
|
`int`, *optional*, defaults to 32
|
Number of attention heads for each attention layer in the Transformer decoder. |
32
|
num_key_value_heads
|
`int`, *optional*
|
This is the number of key_value heads that should be used to
implement Grouped Query Attention. If
|
None
|
rotary_pct
|
`float`, *optional*, defaults to 0.25
|
percentage of hidden dimensions to allocate to rotary embeddings |
0.25
|
intermediate_size
|
{obj}`int`, `optional`, defaults to 8192
|
Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder. |
None
|
defaults
|
to {obj}`"gelu_new"`
|
The non-linear activation function (function or string) in the
encoder and pooler. If string, {obj} |
required |
embed_dropout
|
{obj}`float`, `optional`, defaults to 0.0
|
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler. |
0.0
|
attention_dropout
|
{obj}`float`, `optional`, defaults to 0.0
|
The dropout ratio for the attention probabilities. |
0.0
|
max_position_embeddings
|
{obj}`int`, `optional`, defaults to 2048
|
The maximum sequence length that this model might ever be used with. Typically set this to something large just in case (e.g., 512 or 1024 or 2048). |
2048
|
type_vocab_size
|
{obj}`int`, `optional`, defaults to 2
|
The vocabulary size of the {obj} |
required |
initializer_range
|
{obj}`float`, `optional`, defaults to 0.02
|
The standard deviation of the truncated_normal_initializer for initializing all weight matrices. |
0.02
|
layer_norm_epsilon
|
{obj}`float`, `optional`, defaults to 1e-5
|
The epsilon used by the layer normalization layers. |
1e-06
|
use_cache
|
{obj}`bool`, `optional`, defaults to {obj}`True`
|
Whether or not the model should return the last key/values
attentions (not used by all models).
Only relevant if |
True
|
defaults
|
to {obj}`False`
|
If True, use gradient checkpointing to save memory at the expense of slower backward pass. |
required |
Example
|
required |
Source code in vllm/transformers_utils/configs/exaone.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
|
attribute_map
class-attribute
instance-attribute
¶
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
rescale_before_lm_head
instance-attribute
¶
__init__
¶
__init__(
vocab_size=102400,
max_position_embeddings=2048,
hidden_size=2048,
num_layers=32,
num_attention_heads=32,
num_key_value_heads=None,
intermediate_size=None,
activation_function="silu",
rotary_pct=0.25,
resid_dropout=0.0,
embed_dropout=0.0,
attention_dropout=0.0,
layer_norm_epsilon=1e-06,
initializer_range=0.02,
use_cache=True,
bos_token_id=0,
eos_token_id=2,
tie_word_embeddings=True,
**kwargs,
)
Source code in vllm/transformers_utils/configs/exaone.py
JAISConfig
¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a
[JAISModel
]. It is used to instantiate a JAIS model according to the
specified arguments, defining the model architecture.
Configuration objects inherit from [PretrainedConfig
] and can be used
to control the model outputs. Read the documentation from
[PretrainedConfig
] for more information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vocab_size
|
`int`, *optional*, defaults to 50257
|
Vocabulary size of the JAIS model. Defines the number of different
tokens that can be represented by the
|
50257
|
n_positions
|
`int`, *optional*, defaults to 1024
|
The maximum sequence length that this model might ever be used with. Typically set this to something large just in case (e.g., 512 or 1024 or 2048). |
1024
|
n_embd
|
`int`, *optional*, defaults to 768
|
Dimensionality of the embeddings and hidden states. |
768
|
n_layer
|
`int`, *optional*, defaults to 12
|
Number of hidden layers in the Transformer encoder. |
12
|
n_head
|
`int`, *optional*, defaults to 12
|
Number of attention heads for each attention layer in the Transformer encoder. |
12
|
n_inner
|
`int`, *optional*, defaults to None
|
Dimensionality of the inner feed-forward layers. |
None
|
activation_function
|
`str`, *optional*, defaults to `"gelu"`
|
Activation function, to be selected in the list
|
'gelu_new'
|
resid_pdrop
|
`float`, *optional*, defaults to 0.1
|
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler. |
0.1
|
embd_pdrop
|
`float`, *optional*, defaults to 0.1
|
The dropout ratio for the embeddings. |
0.1
|
attn_pdrop
|
`float`, *optional*, defaults to 0.1
|
The dropout ratio for the attention. |
0.1
|
layer_norm_epsilon
|
`float`, *optional*, defaults to 1e-5
|
The epsilon to use in the layer normalization layers. |
1e-05
|
initializer_range
|
`float`, *optional*, defaults to 0.02
|
The standard deviation of the truncated_normal_initializer for initializing all weight matrices. |
0.02
|
scale_attn_weights
|
`bool`, *optional*, defaults to `True`
|
Scale attention weights by dividing by sqrt(hidden_size).. |
True
|
use_cache
|
`bool`, *optional*, defaults to `True`
|
Whether or not the model should return the last key/values attentions (not used by all models). |
True
|
reorder_and_upcast_attn
|
`bool`, *optional*, defaults to `False`
|
Whether to scale keys (K) prior to computing attention (dot-product) and upcast attention dot-product/softmax to float() when training with mixed precision. |
False
|
position_embedding_type
|
`str`, *optional*, defaults to `"learned"`
|
Positional embedding can be either |
'learned'
|
mup_width_scale
|
`float`, *optional*, defaults to 1.0
|
muP parameter to scale learning rate and initializers. Calculated
as ( |
1.0
|
mup_embeddings_scale
|
`float`, *optional*, defaults to 1.0
|
muP parameter to scale token and position embeddings. |
1.0
|
mup_output_alpha
|
`float`, *optional*, defaults to 1.0
|
muP parameter to scale output logits
( |
1.0
|
mup_scale_qk_dot_by_d
|
`bool`, *optional*, defaults to `False`
|
Scale attention weights by dividing by hidden_size instead of
sqrt(hidden_size). Need to set scale_attn_weights to |
False
|
alibi_scaling
|
`dict`, *optional*
|
Dictionary containing the scaling configuration for ALiBi
embeddings. Currently only supports linear
scaling strategy. Can specify either the scaling |
None
|
architectures
|
`list`, *optional*, defaults to ['JAISLMHeadModel']
|
architecture names for Jais. |
None
|
Example:
>>> from transformers import JAISConfig, JAISModel
>>> # Initializing a JAIS configuration
>>> configuration = JAISConfig()
>>> # Initializing a model (with random weights) from the configuration
>>> model = JAISModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in vllm/transformers_utils/configs/jais.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
attribute_map
class-attribute
instance-attribute
¶
attribute_map = {
"hidden_size": "n_embd",
"max_position_embeddings": "n_positions",
"num_attention_heads": "n_head",
"num_hidden_layers": "n_layer",
}
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
scale_attn_by_inverse_layer_idx
instance-attribute
¶
__init__
¶
__init__(
vocab_size=50257,
n_positions=1024,
n_embd=768,
n_layer=12,
n_head=12,
n_inner=None,
activation_function="gelu_new",
resid_pdrop=0.1,
embd_pdrop=0.1,
attn_pdrop=0.1,
layer_norm_epsilon=1e-05,
initializer_range=0.02,
scale_attn_weights=True,
use_cache=True,
bos_token_id=50256,
eos_token_id=50256,
scale_attn_by_inverse_layer_idx=False,
reorder_and_upcast_attn=False,
position_embedding_type="learned",
mup_width_scale=1.0,
mup_embeddings_scale=1.0,
mup_output_alpha=1.0,
mup_scale_qk_dot_by_d=False,
alibi_scaling=None,
architectures=None,
**kwargs,
)
Source code in vllm/transformers_utils/configs/jais.py
_alibi_scaling_validation
¶
Validate the alibi_scaling
configuration.
Source code in vllm/transformers_utils/configs/jais.py
KimiVLConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/kimi_vl.py
media_placeholder_token_id
instance-attribute
¶
__init__
¶
__init__(
vision_config: Optional[
Union[dict, MoonViTConfig]
] = None,
text_config: Optional[
Union[dict, DeepseekV2Config]
] = None,
ignore_index: int = -100,
media_placeholder_token_id: int = 163605,
pad_token_id: int = 0,
**kwargs,
)
Source code in vllm/transformers_utils/configs/kimi_vl.py
MLPSpeculatorConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/mlp_speculator.py
__init__
¶
__init__(
vocab_size: int = 32000,
emb_dim: int = 4096,
inner_dim: int = 0,
n_predict: int = 3,
top_k_tokens_per_head: Optional[list[int]] = None,
n_candidates: int = 5,
tie_weights: bool = False,
scale_input: bool = False,
**kwargs,
)
Initialize an MLPSpeculatorConfig
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vocab_size
|
int
|
int the model vocab size |
32000
|
emb_dim
|
int
|
int the model embedding dimension |
4096
|
inner_dim
|
int
|
int the inner dimension of the model. If 0, will be the emb_dim. |
0
|
n_predict
|
int
|
int the number of lookaheads for the speculator |
3
|
top_k_tokens_per_head
|
Optional[list[int]]
|
list[int] Number of tokens to consider from each head when forming the candidate tree. For each candidate branch in the tree, head n produces topk[n] additional sub-branches. NOTE: This parameter is currently unused. |
None
|
n_candidates
|
int
|
int number of child candidates to create per sequence |
5
|
tie_weights
|
bool
|
bool If true, use a single set of weights for every model head/stage after the first. The initial projection from the base model may have a different size, so that stays separate. |
False
|
scale_input
|
bool
|
bool if True, will scale the initial hidden states from the base model. |
False
|
Source code in vllm/transformers_utils/configs/mlp_speculator.py
MPTConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/mpt.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
attribute_map
class-attribute
instance-attribute
¶
attribute_map = {
"num_attention_heads": "n_heads",
"hidden_size": "d_model",
"num_hidden_layers": "n_layers",
}
__init__
¶
__init__(
d_model: int = 2048,
n_heads: int = 16,
n_layers: int = 24,
expansion_ratio: int = 4,
max_seq_len: int = 2048,
vocab_size: int = 50368,
resid_pdrop: float = 0.0,
emb_pdrop: float = 0.0,
learned_pos_emb: bool = True,
attn_config: dict = attn_config_defaults,
ffn_config: dict = ffn_config_defaults,
init_device: str = "cpu",
logit_scale: Optional[Union[float, str]] = None,
no_bias: bool = False,
embedding_fraction: float = 1.0,
norm_type: str = "low_precision_layernorm",
use_cache: bool = False,
init_config: dict = init_config_defaults,
fc_type: str = "torch",
verbose: Optional[int] = None,
**kwargs: Any,
)
Source code in vllm/transformers_utils/configs/mpt.py
_set_config_defaults
¶
_validate_config
¶
Source code in vllm/transformers_utils/configs/mpt.py
MedusaConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/medusa.py
truncated_vocab_size
instance-attribute
¶
__init__
¶
__init__(
hidden_size: int = 4096,
vocab_size: int = 32001,
num_heads: int = 5,
num_hidden_layers: int = 1,
max_paths: int = 64,
topk: int = 10,
truncated_vocab_size: Optional[int] = None,
**kwargs,
)
Source code in vllm/transformers_utils/configs/medusa.py
from_pretrained
classmethod
¶
from_pretrained(
pretrained_model_name_or_path: Union[str, PathLike],
**kwargs,
) -> MedusaConfig
Source code in vllm/transformers_utils/configs/medusa.py
MiniMaxText01Config
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/minimax_text_01.py
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
__init__
¶
__init__(
vocab_size=32000,
hidden_size=4096,
intermediate_size=14336,
num_hidden_layers=32,
num_attention_heads=32,
num_key_value_heads=8,
hidden_act="silu",
max_position_embeddings=4096 * 32,
initializer_range=0.02,
rms_norm_eps=1e-05,
use_cache=True,
pad_token_id=None,
bos_token_id=None,
eos_token_id=None,
tie_word_embeddings=False,
rope_theta=1000000.0,
sliding_window=None,
attention_dropout=0.0,
num_experts_per_tok=2,
num_local_experts=8,
output_router_logits=False,
router_aux_loss_coef=0.001,
router_jitter_noise=0.0,
**kwargs,
)
Source code in vllm/transformers_utils/configs/minimax_text_01.py
MiniMaxVL01Config
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/minimax_vl_01.py
vision_feature_select_strategy
instance-attribute
¶
__init__
¶
__init__(
vision_config=None,
text_config=None,
ignore_index=-100,
image_token_index=32000,
projector_hidden_act="gelu",
vision_feature_select_strategy="default",
vision_feature_layer=-2,
image_grid_pinpoints=None,
tie_word_embeddings=False,
image_seq_length=576,
**kwargs,
)
Source code in vllm/transformers_utils/configs/minimax_vl_01.py
MllamaConfig
¶
MoonViTConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/moonvit.py
__init__
¶
__init__(
patch_size: int = 14,
init_pos_emb_height: int = 64,
init_pos_emb_width: int = 64,
num_attention_heads: int = 16,
num_hidden_layers: int = 27,
hidden_size: int = 1152,
intermediate_size: int = 4304,
merge_kernel_size: tuple[int, int] = (2, 2),
**kwargs,
)
Source code in vllm/transformers_utils/configs/moonvit.py
NVLM_D_Config
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/nvlm_d.py
__init__
¶
Source code in vllm/transformers_utils/configs/nvlm_d.py
NemotronConfig
¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a
[NemotronModel
]. It is used to instantiate an Nemotron model
according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar
configuration to that of the Nemotron-8B.
Configuration objects inherit from [PretrainedConfig
] and can be
used to control the model outputs. Read the documentation from
[PretrainedConfig
] for more information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vocab_size
|
`int`, *optional*, defaults to 256000
|
Vocabulary size of the Nemotron model. Defines the number of
different tokens that can be represented by the
|
256000
|
hidden_size
|
`int`, *optional*, defaults to 6144
|
Dimension of the hidden representations. |
6144
|
intermediate_size
|
`int`, *optional*, defaults to 24576
|
Dimension of the MLP representations. |
24576
|
num_hidden_layers
|
`int`, *optional*, defaults to 32
|
Number of hidden layers in the Transformer decoder. |
32
|
num_attention_heads
|
`int`, *optional*, defaults to 48
|
Number of attention heads for each attention layer in the Transformer decoder. |
48
|
head_dim
|
`int`, *optional*
|
Projection weights dimension in multi-head attention. Set to hidden_size // num_attention_heads if None |
None
|
num_key_value_heads
|
`int`, *optional*
|
This is the number of key_value heads that should be used to
implement Grouped Query Attention. If
|
None
|
hidden_act
|
`str` or `function`, *optional*, defaults to `"relu2"`
|
The non-linear activation function (function or string) in the decoder. |
'relu2'
|
max_position_embeddings
|
`int`, *optional*, defaults to 4096
|
The maximum sequence length that this model might ever be used with. |
4096
|
initializer_range
|
`float`, *optional*, defaults to 0.0134
|
The standard deviation of the truncated_normal_initializer for initializing all weight matrices. |
0.0134
|
norm_eps
|
`float`, *optional*, defaults to 1e-05
|
The epsilon used by the normalization layers. |
1e-05
|
use_cache
|
`bool`, *optional*, defaults to `True`
|
Whether or not the model should return the last key/values
attentions (not used by all models). Only relevant if
|
True
|
pad_token_id
|
`int`, *optional*
|
Padding token id. |
None
|
bos_token_id
|
`int`, *optional*, defaults to 2
|
Beginning of stream token id. |
2
|
eos_token_id
|
`int`, *optional*, defaults to 3
|
End of stream token id. |
3
|
tie_word_embeddings
|
`bool`, *optional*, defaults to `False`
|
Whether to tie weight embeddings |
False
|
rope_theta
|
`float`, *optional*, defaults to 10000.0
|
The base period of the RoPE embeddings. |
10000.0
|
partial_rotary_factor
|
`float`, *optional*, defaults to 0.5
|
Percentage of the query and keys which will have rotary embedding. |
0.5
|
attention_bias
|
`bool`, *optional*, defaults to `False`
|
Whether to use a bias in the query, key, value and output projection layers during self-attention. |
False
|
attention_dropout
|
`float`, *optional*, defaults to 0.0
|
The dropout ratio for the attention probabilities. |
0.0
|
mlp_bias
|
`bool`, *optional*, defaults to `False`
|
Whether to use a bias in up_proj and down_proj layers in the MLP layers. |
False
|
>>> from transformers import NemotronModel, NemotronConfig
>>> # Initializing a Nemotron nemotron-15b style configuration
>>> configuration = NemotronConfig()
>>> # Initializing a model from the nemotron-15b style configuration
>>> model = NemotronModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in vllm/transformers_utils/configs/nemotron.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
head_dim
instance-attribute
¶
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
__init__
¶
__init__(
vocab_size=256000,
hidden_size=6144,
intermediate_size=24576,
num_hidden_layers=32,
num_attention_heads=48,
head_dim=None,
num_key_value_heads=None,
hidden_act="relu2",
max_position_embeddings=4096,
initializer_range=0.0134,
norm_eps=1e-05,
use_cache=True,
pad_token_id=None,
bos_token_id=2,
eos_token_id=3,
tie_word_embeddings=False,
rope_theta=10000.0,
rope_scaling=None,
partial_rotary_factor=0.5,
attention_bias=False,
attention_dropout=0.0,
mlp_bias=False,
**kwargs,
)
Source code in vllm/transformers_utils/configs/nemotron.py
_rope_scaling_validation
¶
Validate the rope_scaling
configuration.
Source code in vllm/transformers_utils/configs/nemotron.py
NemotronHConfig
¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a
[NemotronHModel
]. It is used to instantiate a NemotronH model according
to the specified arguments, defining the model architecture. Instantiating
a configuration with the defaults will yield a similar configuration to
that of the NemotronH-v0.1 model.
Args:
vocab_size (int
, optional, defaults to 131072):
Vocabulary size of the NemotronH model. Defines the number of
different tokens that can be represented by the inputs_ids
passed when calling [NemotronHModel
]
tie_word_embeddings (bool
, optional, defaults to False
):
Whether the model's input and output word embeddings should be
tied. Note that this is only relevant if the model has a output
word embedding layer.
hidden_size (int
, optional, defaults to 4096):
Dimension of the hidden representations.
intermediate_size (int
, optional, defaults to 21504):
Dimension of the MLP representations.
num_hidden_layers (int
, optional, defaults to 52):
Number of hidden layers in the Transformer encoder.
hybrid_override_pattern (str
, optional, defaults to
"M-M-M-M*-M-M-M-M-M*-M-M-M-M-M*-M-M-M-M-M*-M-M-M-M-M-"
):
The pattern of the hybrid model. The pattern is a string of
characters where each character represents
M: Mamba2, : Attention, -: MLP
num_attention_heads (int
, optional, defaults to 32):
Number of attention heads for each attention layer in the
Transformer encoder.
attention_head_dim (int
, optional, defaults to 128):
Dimension of each attention head.
num_key_value_heads (int
, optional, defaults to 8):
This is the number of key_value heads that should be used to
implement Grouped Query Attention. If
num_key_value_heads=num_attention_heads
, the model will use
Multi Head Attention (MHA), if num_key_value_heads=1
the model
will use Multi Query Attention (MQA) otherwise GQA is used.
mlp_hidden_act (str
, optional, defaults to "relu2"):
The non-linear activation function in the MLP layers.
attention_bias (bool
, optional, defaults to False
):
Whether to use bias in attention layers.
mlp_bias (bool
, optional, defaults to False
):
Whether to use bias in MLP layers.
use_bias (bool
, optional, defaults to False
):
Whether to use bias in the model.
initializer_range (float
, optional, defaults to 0.02):
The standard deviation of the truncated_normal_initializer for
initializing all weight matrices.
layer_norm_epsilon (float
, optional, defaults to 1e-5):
The epsilon used by the layer normalization layers.
residual_in_fp32 (bool
, optional, defaults to False
):
Whether or not residuals should be in float32
. If set to False
residuals will keep the same dtype
as the rest of the model.
use_cache (bool
, optional, defaults to True
):
Whether or not the model should return the last key/values
attentions (not used by all models). Only relevant if
config.is_decoder=True
.
num_logits_to_keep (int
or None
, optional, defaults to 1):
Number of prompt logits to calculate during generation. If None
,
all logits will be calculated. If an integer value, only last
num_logits_to_keep
logits will be calculated.
pad_token_id (int
, optional, defaults to 0):
The id of the padding token.
bos_token_id (int
, optional, defaults to 1):
The id of the "beginning-of-sequence" token.
eos_token_id (int
, optional, defaults to 2):
The id of the "end-of-sequence" token.
sliding_window (int
, optional, defaults to None):
Sliding window attention window size.
max_position_embeddings (int
, optional, defaults to 4096):
The maximum sequence length that this model might ever be used
with.
attention_dropout (float
, optional, defaults to 0.0):
The dropout ratio for the attention probabilities.
hidden_dropout (float
, optional, defaults to 0.0):
The dropout ratio for the hidden states.
use_mamba_kernels (bool
, optional, defaults to True
):
Flag indicating whether or not to use the fast mamba kernels.
These are available only if mamba-ssm
and causal-conv1d
are installed, and the mamba modules are running on a CUDA device.
ssm_state_size (int
, optional, defaults to 128):
The dimension of the mamba state space latents.
mamba_num_heads (int
, optional, defaults to 128):
Number of heads in Mamba layers.
mamba_n_groups (int
, optional, defaults to 8):
Number of groups in Mamba layers.
mamba_head_dim (int
, optional, defaults to 64):
Dimension of each Mamba head.
mamba_d_conv (int
, optional, defaults to 4):
The size of the mamba convolution kernel.
mamba_expand (int
, optional, defaults to 2):
Expanding factor used to determine the mamba intermediate size.
mamba_hidden_act (str
, optional, defaults to "silu"):
The non-linear activation function in the Mamba layers.
mamba_dt_min (float
, optional, defaults to 0.001):
Minimum value for the time step in Mamba.
mamba_dt_max (float
, optional, defaults to 0.1):
Maximum value for the time step in Mamba.
mamba_dt_limit (tuple
, optional, defaults to (0.0, float("inf"))):
Limits for the time step in Mamba.
mamba_dt_init_floor (float
, optional, defaults to 1e-4):
Floor value for time step initialization in Mamba.
mamba_conv_bias (bool
, optional, defaults to True
):
Whether to use bias in the convolution layer of the mamba mixer
block.
mamba_proj_bias (bool
, optional, defaults to False
):
Whether to use bias in the input and output projections of the
mamba mixer block.
mamba_chunk_size (int
, optional, defaults to 256):
Size of chunks for Mamba processing.
rescale_prenorm_residual (bool
, optional*, defaults to True
):
Whether to rescale the pre-normalization residual connections.
Source code in vllm/transformers_utils/configs/nemotron_h.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
|
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
__init__
¶
__init__(
vocab_size=131072,
tie_word_embeddings=False,
hidden_size=4096,
intermediate_size=21504,
num_hidden_layers=52,
hybrid_override_pattern="M-M-M-M*-M-M-M-M-M*-M-M-M-M-M*-M-M-M-M-M*-M-M-M-M-M-",
num_attention_heads=32,
attention_head_dim=128,
num_key_value_heads=8,
mlp_hidden_act="relu2",
attention_bias=False,
mlp_bias=False,
use_bias=False,
initializer_range=0.02,
layer_norm_epsilon=1e-05,
residual_in_fp32=False,
use_cache=True,
num_logits_to_keep=1,
pad_token_id=0,
bos_token_id=1,
eos_token_id=2,
sliding_window=None,
max_position_embeddings=4096,
attention_dropout=0.0,
hidden_dropout=0.0,
use_mamba_kernels=True,
ssm_state_size=128,
mamba_num_heads=128,
mamba_n_groups=8,
mamba_head_dim=64,
mamba_d_conv=4,
mamba_expand=2,
mamba_hidden_act="silu",
mamba_dt_min=0.001,
mamba_dt_max=0.1,
mamba_dt_limit=(0.0, float("inf")),
mamba_dt_init_floor=0.0001,
mamba_conv_bias=True,
mamba_proj_bias=False,
mamba_chunk_size=256,
rescale_prenorm_residual=True,
**kwargs,
)
Source code in vllm/transformers_utils/configs/nemotron_h.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
|
OvisConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/ovis.py
conversation_formatter_class
instance-attribute
¶
__init__
¶
__init__(
llm_config: Optional[
Union[PretrainedConfig, dict]
] = None,
visual_tokenizer_config: Optional[
Union[PretrainedConfig, dict]
] = None,
multimodal_max_length=8192,
hidden_size=None,
conversation_formatter_class=None,
llm_attn_implementation=None,
disable_tie_weight=False,
**kwargs,
)
Source code in vllm/transformers_utils/configs/ovis.py
RWConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/falcon.py
attribute_map
class-attribute
instance-attribute
¶
attribute_map = {
"num_hidden_layers": "n_layer",
"num_attention_heads": "n_head",
"num_kv_heads": "n_head_kv",
}
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
__init__
¶
__init__(
vocab_size=250880,
hidden_size=64,
n_layer=2,
n_head=8,
layer_norm_epsilon=1e-05,
initializer_range=0.02,
use_cache=True,
bos_token_id=1,
eos_token_id=2,
hidden_dropout=0.0,
attention_dropout=0.0,
multi_query=True,
n_head_kv=None,
alibi=False,
bias=False,
parallel_attn=False,
new_decoder_architecture=False,
**kwargs,
) -> None
Source code in vllm/transformers_utils/configs/falcon.py
SkyworkR1VChatConfig
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/skyworkr1v.py
__init__
¶
__init__(
vision_config=None,
llm_config=None,
use_backbone_lora=0,
use_llm_lora=0,
select_layer=-1,
force_image_size=None,
downsample_ratio=0.5,
template=None,
dynamic_image_size=False,
use_thumbnail=False,
ps_version="v1",
min_dynamic_patch=1,
max_dynamic_patch=6,
**kwargs,
)
Source code in vllm/transformers_utils/configs/skyworkr1v.py
SolarConfig
¶
Bases: PretrainedConfig
This is the configuration class to store
the configuration of a [SolarModel
].
It is used to instantiate an LLaMA model
according to the specified arguments,
defining the model architecture.
Instantiating a configuration with the
defaults will yield a similar
configuration to that of the LLaMA-7B.
Configuration objects inherit from [PretrainedConfig
]
and can be used to control the model outputs.
Read the documentation from [PretrainedConfig
] for more information.
Args:
vocab_size (int
, optional, defaults to 32000):
Vocabulary size of the LLaMA model.
Defines the number of different tokens
that can be represented by the inputs_ids
passed when calling [SolarModel
]
hidden_size (int
, optional, defaults to 4096):
Dimension of the hidden representations.
intermediate_size (int
, optional, defaults to 11008):
Dimension of the MLP representations.
num_hidden_layers (int
, optional, defaults to 32):
Number of hidden layers in the Transformer decoder.
num_attention_heads (int
, optional, defaults to 32):
Number of attention heads for each attention layer
in the Transformer decoder.
num_key_value_heads (int
, optional):
This is the number of key_value heads that
should be used to implement Grouped Query Attention. If
num_key_value_heads=num_attention_heads
,
the model will use Multi Head Attention (MHA), if
num_key_value_heads=1
the model
will use Multi Query Attention (MQA)
otherwise GQA is used. When
converting a multi-head checkpoint to a GQA checkpoint,
each group key and value head should be constructed
by meanpooling all the original heads within that group.
For more details checkout [this paper]
(https://arxiv.org/pdf/2305.13245.pdf).
If it is not specified, will default to
num_attention_heads
.
hidden_act (str
or function
, optional, defaults to "silu"
):
The non-linear activation function (function or string)
in the decoder.
max_position_embeddings (int
, optional, defaults to 2048):
The maximum sequence length that this model might ever be used with.
Solar 1 supports up to 2048 tokens,
Solar 2 up to 4096, CodeSolar up to 16384.
initializer_range (float
, optional, defaults to 0.02):
The standard deviation of
the truncated_normal_initializer for initializing
all weight matrices.
rms_norm_eps (float
, optional, defaults to 1e-06):
The epsilon used by the rms normalization layers.
use_cache (bool
, optional, defaults to True
):
Whether or not the model should return
the last key/values attentions (not used by all models). Only
relevant if config.is_decoder=True
.
pad_token_id (int
, optional):
Padding token id.
bos_token_id (int
, optional, defaults to 1):
Beginning of stream token id.
eos_token_id (int
, optional, defaults to 2):
End of stream token id.
pretraining_tp (int
, optional, defaults to 1):
Experimental feature. Tensor parallelism rank
used during pretraining.
Please refer to this
document
to understand more about it. This value is
necessary to ensure exact reproducibility
of the pretraining results.
Please refer to this
issue.
tie_word_embeddings (bool
, optional, defaults to False
):
Whether to tie weight embeddings
rope_theta (float
, optional, defaults to 10000.0):
The base period of the RoPE embeddings.
rope_scaling (dict
, optional):
Dictionary containing the scaling configuration for
the RoPE embeddings.
Currently supports two scaling
strategies: linear and dynamic.
Their scaling factor must be a float greater than 1.
The expected format is
{"type": strategy name, "factor": scaling factor}
.
When using this flag, don't update
max_position_embeddings
to the expected new maximum.
See the following thread for more information on how
these scaling strategies behave:
https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/
dynamically_scaled_rope_further_increases/. This is an
experimental feature, subject to breaking
API changes in future versions.
attention_bias (bool
, optional, defaults to False
):
Whether to use a bias in the query, key, value
and output projection layers during self-attention.
attention_dropout (float
, optional, defaults to 0.0):
The dropout ratio for the attention probabilities.
mlp_bias (bool
, optional, defaults to False
):
Whether to use a bias in up_proj, down_proj and gate_proj
layers in the MLP layers.
sliding_window (int
, optional, defaults to 2047):
Sliding window attention window size. If not specified,
will default to 2047
.
>>> from transformers import SolarModel, SolarConfig
>>> # Initializing a Solar-pro style configuration
>>> configuration = SolarConfig()
>>> # Initializing a model from the Solar-pro style configuration
>>> model = SolarModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in vllm/transformers_utils/configs/solar.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
|
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
__init__
¶
__init__(
vocab_size=32000,
hidden_size=4096,
intermediate_size=11008,
num_hidden_layers=32,
num_attention_heads=32,
num_key_value_heads=None,
hidden_act="silu",
max_position_embeddings=2048,
initializer_range=0.02,
rms_norm_eps=1e-06,
use_cache=True,
pad_token_id=None,
bos_token_id=1,
eos_token_id=2,
pretraining_tp=1,
tie_word_embeddings=False,
rope_theta=10000.0,
rope_scaling=None,
attention_bias=False,
attention_dropout=0.0,
mlp_bias=False,
sliding_window=2047,
bskcn_1=None,
bskcn_2=None,
bskcn_3=None,
bskcn_4=None,
bskcn_tv=None,
**kwargs,
)
Source code in vllm/transformers_utils/configs/solar.py
_rope_scaling_validation
¶
Validate the rope_scaling
configuration.
Source code in vllm/transformers_utils/configs/solar.py
Telechat2Config
¶
Bases: PretrainedConfig
Source code in vllm/transformers_utils/configs/telechat2.py
apply_residual_connection_post_layernorm
instance-attribute
¶
attribute_map
class-attribute
instance-attribute
¶
attribute_map = {
"num_hidden_layers": "n_layer",
"num_attention_heads": "n_head",
"intermediate_size": "ffn_hidden_size",
"rms_norm_eps": "layer_norm_epsilon",
}
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
__init__
¶
__init__(
vocab_size=160256,
hidden_size=4096,
n_layer=30,
n_head=32,
layer_norm_epsilon=1e-05,
initializer_range=0.02,
use_cache=True,
bos_token_id=1,
eos_token_id=2,
apply_residual_connection_post_layernorm=False,
hidden_dropout=0.0,
attention_dropout=0.0,
ffn_hidden_size=12288,
training_seqlen=8192,
logn=True,
embed_layernorm=False,
hidden_act="silu",
**kwargs,
)
Source code in vllm/transformers_utils/configs/telechat2.py
UltravoxConfig
¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a
[UltravoxForConditionalGeneration
]. It is used to instantiate an
Ultravox model according to the specified arguments, defining the model
architecture.
Configuration objects inherit from [PretrainedConfig
] and can be used to
control the model outputs. Read the documentation from [PretrainedConfig
]
for more information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
audio_config
|
`Union[AutoConfig, dict]`, *optional*
|
Custom audio config or dict |
None
|
text_config
|
`Union[AutoConfig, dict]`, *optional*
|
The config object of the text backbone. Can be any of |
None
|
ignore_index
|
`int`, *optional*, defaults to -100
|
The ignore index for the loss function. |
-100
|
audio_token_index
|
`int`, *optional*, defaults to 32000
|
The audio token index to encode the audio prompt. |
32000
|
stack_factor
|
`int`, *optional*, defaults to 8
|
Audio downsampling factor for the multimodal projector. |
8
|
norm_init
|
`float`, *optional*, defaults to 0.4
|
The initialization value for the layer normalization. |
0.4
|
projector_act
|
`str`, *optional*, defaults to `"swiglu"`
|
The activation function used by the multimodal projector. |
'swiglu'
|
text_model_lora_config
|
`LoraConfigSimplified`, *optional*
|
The LoRA configuration for finetuning the text model. |
None
|
audio_model_lora_config
|
`LoraConfigSimplified`, *optional*
|
The LoRA configuration for finetuning the audio model. |
None
|
projector_ln_mid
|
`bool`, *optional*, defaults to `False`
|
Whether to apply layer normalization at the middle of the
projector or at the end. Versions v0.4.1 and below
use |
False
|
Source code in vllm/transformers_utils/configs/ultravox.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
audio_config
instance-attribute
¶
audio_config = get_config(
audio_model_id, trust_remote_code=False
)
audio_model_lora_config
instance-attribute
¶
__init__
¶
__init__(
audio_config: Optional[dict[str, Any]] = None,
text_config: Optional[dict[str, Any]] = None,
audio_model_id: Optional[str] = None,
text_model_id: Optional[str] = None,
ignore_index: int = -100,
audio_token_index: int = 32000,
hidden_size: int = 4096,
stack_factor: int = 8,
norm_init: float = 0.4,
projector_act: str = "swiglu",
text_model_lora_config: Optional[dict[str, Any]] = None,
audio_model_lora_config: Optional[
dict[str, Any]
] = None,
projector_ln_mid: bool = False,
**kwargs,
)