vllm.model_executor.models.whisper_utils ¶
ISO639_1_SUPPORTED_LANGS module-attribute ¶
ISO639_1_SUPPORTED_LANGS = {
"af": "Afrikaans",
"ar": "Arabic",
"hy": "Armenian",
"az": "Azerbaijani",
"be": "Belarusian",
"bs": "Bosnian",
"bg": "Bulgarian",
"ca": "Catalan",
"zh": "Chinese",
"hr": "Croatian",
"cs": "Czech",
"da": "Danish",
"nl": "Dutch",
"en": "English",
"et": "Estonian",
"fi": "Finnish",
"fr": "French",
"gl": "Galician",
"de": "German",
"el": "Greek",
"he": "Hebrew",
"hi": "Hindi",
"hu": "Hungarian",
"is": "Icelandic",
"id": "Indonesian",
"it": "Italian",
"ja": "Japanese",
"kn": "Kannada",
"kk": "Kazakh",
"ko": "Korean",
"lv": "Latvian",
"lt": "Lithuanian",
"mk": "Macedonian",
"ms": "Malay",
"mr": "Marathi",
"mi": "Maori",
"ne": "Nepali",
"no": "Norwegian",
"fa": "Persian",
"pl": "Polish",
"pt": "Portuguese",
"ro": "Romanian",
"ru": "Russian",
"sr": "Serbian",
"sk": "Slovak",
"sl": "Slovenian",
"es": "Spanish",
"sw": "Swahili",
"sv": "Swedish",
"tl": "Tagalog",
"ta": "Tamil",
"th": "Thai",
"tr": "Turkish",
"uk": "Ukrainian",
"ur": "Urdu",
"vi": "Vietnamese",
"cy": "Welsh",
}
WhisperAttentionWithBlockPooling ¶
Bases: Attention
Attention layer with block pooling.
Source code in vllm/model_executor/models/whisper_utils.py
__init__ ¶
__init__(
num_heads: int,
head_size: int,
scale: float,
num_kv_heads: int | None = None,
alibi_slopes: list[float] | None = None,
cache_config: CacheConfig | None = None,
quant_config: QuantizationConfig | None = None,
logits_soft_cap: float | None = None,
per_layer_sliding_window: int | None = None,
prefix: str = "",
attn_type: str = DECODER,
kv_sharing_target_layer_name: str | None = None,
block_pool_size: int = 1,
attn_backend: type[AttentionBackend] | None = None,
**extra_impl_args,
) -> None
Source code in vllm/model_executor/models/whisper_utils.py
get_kv_cache_spec ¶
get_kv_cache_spec(vllm_config: VllmConfig)
Source code in vllm/model_executor/models/whisper_utils.py
WhisperCausalConv1d ¶
Bases: Conv1d
Source code in vllm/model_executor/models/whisper_utils.py
_effective_kernel_size instance-attribute ¶
__init__ ¶
__init__(
in_channels: int,
out_channels: int,
kernel_size: int,
stride: int = 1,
padding: int = 0,
bias: bool = True,
) -> None
Source code in vllm/model_executor/models/whisper_utils.py
forward ¶
Source code in vllm/model_executor/models/whisper_utils.py
_pad1d ¶
_pad1d(
x: Tensor,
paddings: tuple[int, int],
mode: str = "constant",
value: float = 0.0,
) -> Tensor
Tiny wrapper around F.pad, just to allow for reflect padding on small input. If this is the case, we insert extra 0 padding to the right before the reflection happen.
Source code in vllm/model_executor/models/whisper_utils.py
create_whisper_attention_backend_with_block_pooling cached ¶
create_whisper_attention_backend_with_block_pooling(
underlying_attn_backend: AttentionBackend,
block_pool_size: int,
) -> type[AttentionBackend]
Source code in vllm/model_executor/models/whisper_utils.py
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 | |