vllm.transformers_utils.configs.qwen3_asr ¶
__all__ module-attribute ¶
Qwen3ASRAudioEncoderConfig ¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a [Qwen3ASRAudioEncoder]. It is used to instantiate a Qwen3-ASR audio encoder according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the audio encoder of the Qwen2-Audio architecture.
e.g. Qwen/Qwen3-ASR-1.7B
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 |
|---|---|---|---|
num_mel_bins | `int`, *optional*, defaults to 128 | Number of mel features used per input features. Should correspond to the value used in the | 128 |
encoder_layers | `int`, *optional*, defaults to 32 | Number of encoder layers. | 32 |
encoder_attention_heads | `int`, *optional*, defaults to 20 | Number of attention heads for each attention layer in the Transformer encoder. | 20 |
encoder_ffn_dim | `int`, *optional*, defaults to 5120 | Dimensionality of the "intermediate" (often named feed-forward) layer in encoder. | 5120 |
d_model | `int`, *optional*, defaults to 1280 | Dimensionality of the layers. | 1280 |
dropout | `float`, *optional*, defaults to 0.0 | The dropout probability for all fully connected layers in the embeddings, encoder, and pooler. | 0 |
attention_dropout | `float`, *optional*, defaults to 0.0 | The dropout ratio for the attention probabilities. | 0 |
activation_function | `str`, *optional*, defaults to `"gelu"` | The non-linear activation function (function or string) in the encoder and pooler. If string, | 'gelu' |
activation_dropout | `float`, *optional*, defaults to 0.0 | The dropout ratio for activations inside the fully connected layer. | 0 |
scale_embedding | `bool`, *optional*, defaults to `False` | Scale embeddings by diving by sqrt(d_model). | False |
initializer_range | `float`, *optional*, defaults to 0.02 | The standard deviation of the truncated_normal_initializer for initializing all weight matrices. | 0.02 |
max_source_positions | `int`, *optional*, defaults to 1500 | The maximum sequence length of log-mel filter-bank features that this model might ever be used with. | 1500 |
n_window | `int`, *optional*, defaults to 100 | The chunk for conv and flash attn in AudioEncoder. | 100 |
output_dim | `int`, *optional*, defaults to 3584 | The output dimension of AudioEncoder. | 3584 |
Example:
>>> from transformers import Qwen3ASRAudioEncoderConfig, Qwen3ASRAudioEncoder
>>> # Initializing a Qwen3ASRAudioEncoderConfig
>>> configuration = Qwen3ASRAudioEncoderConfig()
>>> # Initializing a Qwen3ASRAudioEncoder (with random weights)
>>> model = Qwen3ASRAudioEncoder(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in vllm/transformers_utils/configs/qwen3_asr.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 | |
__init__ ¶
__init__(
num_mel_bins=128,
encoder_layers=32,
encoder_attention_heads=20,
encoder_ffn_dim=5120,
d_model=1280,
dropout=0,
attention_dropout=0,
activation_function="gelu",
activation_dropout=0,
scale_embedding=False,
initializer_range=0.02,
max_source_positions=1500,
n_window=100,
output_dim=3584,
n_window_infer=400,
conv_chunksize=500,
downsample_hidden_size=480,
**kwargs,
)
Source code in vllm/transformers_utils/configs/qwen3_asr.py
Qwen3ASRConfig ¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a [Qwen3ASRForConditionalGeneration]. It is used to instantiate a Qwen3ASR model according to the specified sub-models configurations, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Qwen/Qwen3-ASR-1.7B 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 |
|---|---|---|---|
thinker_config | `dict`, *optional* | Configuration of the underlying thinker sub-model. | None |
support_languages | `List[str]`, *optional* | The languages supported by the model. | None |
Example:
>>> from transformers import (
... Qwen3ASRThinkerConfig,
... Qwen3ASRForConditionalGeneration,
... Qwen3ASRConfig,
... )
>>> # Initializing a Qwen3ASR style configuration
>>> configuration = Qwen3ASRConfig()
>>> # Initializing a model from the configuration
>>> model = Qwen3ASRForConditionalGeneration(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in vllm/transformers_utils/configs/qwen3_asr.py
sub_configs class-attribute instance-attribute ¶
sub_configs = {'thinker_config': Qwen3ASRThinkerConfig}
__init__ ¶
Source code in vllm/transformers_utils/configs/qwen3_asr.py
get_text_config ¶
Returns the config that is meant to be used with text IO. On most models, it is the original config instance itself. On specific composite models, it is under a set of valid names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
decoder | `Optional[bool]`, *optional*, defaults to `False` | If set to | False |
Source code in vllm/transformers_utils/configs/qwen3_asr.py
Qwen3ASRTextConfig ¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a [Qwen3ASRTextModel]. It is used to instantiate a Qwen3-ASR model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of Qwen3-ASR-1.7B Qwen/Qwen3-ASR-1.7B
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 151936 | Vocabulary size of the Qwen3ASR model. Defines the number of different tokens that can be represented by the | 151936 |
hidden_size | `int`, *optional*, defaults to 4096 | Dimension of the hidden representations. | 4096 |
intermediate_size | `int`, *optional*, defaults to 22016 | Dimension of the MLP representations. | 22016 |
num_hidden_layers | `int`, *optional*, defaults to 32 | 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 encoder. | 32 |
num_key_value_heads | `int`, *optional*, defaults to 32 | This is the number of key_value heads that should be used to implement Grouped Query Attention. If | 32 |
head_dim | `int`, *optional*, defaults to 128 | The dimension of the head. If not specified, will default to | 128 |
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 128000 | The maximum sequence length that this model might ever be used with. | 128000 |
initializer_range | `float`, *optional*, defaults to 0.02 | The standard deviation of the truncated_normal_initializer for initializing all weight matrices. | 0.02 |
rms_norm_eps | `float`, *optional*, defaults to 1e-06 | The epsilon used by the rms normalization layers. | 1e-06 |
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 |
tie_word_embeddings | `bool`, *optional*, defaults to `False` | Whether the model's input and output word embeddings should be tied. | False |
rope_theta | `float`, *optional*, defaults to 5000000.0 | The base period of the RoPE embeddings. | 5000000.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 |
>>> from transformers import Qwen3ASRTextModel, Qwen3ASRTextConfig
>>> # Initializing a Qwen3ASR style configuration
>>> configuration = Qwen3ASRTextConfig()
>>> # Initializing a model from the Qwen3-VL-7B style configuration
>>> model = Qwen3ASRTextModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in vllm/transformers_utils/configs/qwen3_asr.py
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 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
__init__ ¶
__init__(
vocab_size=151936,
hidden_size=4096,
intermediate_size=22016,
num_hidden_layers=32,
num_attention_heads=32,
num_key_value_heads=32,
head_dim=128,
hidden_act="silu",
max_position_embeddings=128000,
initializer_range=0.02,
rms_norm_eps=1e-06,
use_cache=True,
tie_word_embeddings=False,
rope_theta=5000000.0,
rope_scaling=None,
attention_bias=False,
attention_dropout=0.0,
**kwargs,
)
Source code in vllm/transformers_utils/configs/qwen3_asr.py
Qwen3ASRThinkerConfig ¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a [Qwen3ASRThinker]. It is used to instantiate a Qwen3-ASR-Thinker 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 thinker component of the Qwen3-Omni architecture.
e.g. Qwen/Qwen3-ASR-1.7B
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 | `dict`, *optional* | The config dictionary of the audio backbone. | None |
text_config | `dict`, *optional* | The config dictionary of the text backbone. | None |
audio_token_id | `int`, *optional*, defaults to 151646 | The audio token id to encode the audio prompt. | 151646 |
audio_start_token_id | `int`, *optional*, defaults to 151647 | The audio start token id to encode the audio prompt. | 151647 |
user_token_id | `int`, *optional*, defaults to 872 | The user token id to encode the user token. | 872 |
initializer_range | `float`, *optional*, defaults to 0.02 | The standard deviation of the truncated_normal_initializer for initializing all weight matrices. | 0.02 |
Example:
>>> from transformers import Qwen3ASRThinkerModel, Qwen3ASRThinkerConfig
>>> # Initializing a default Qwen3ASRThinkerConfig
>>> configuration = Qwen3ASRThinkerConfig()
>>> # Initializing a model (with random weights) from the default configuration
>>> model = Qwen3ASRThinkerModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in vllm/transformers_utils/configs/qwen3_asr.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | |
sub_configs class-attribute instance-attribute ¶
sub_configs = {
"audio_config": Qwen3ASRAudioEncoderConfig,
"text_config": Qwen3ASRTextConfig,
}
__init__ ¶
__init__(
audio_config=None,
text_config=None,
audio_token_id=151646,
audio_start_token_id=151647,
user_token_id=872,
initializer_range=0.02,
**kwargs,
)