Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
731a6940
Unverified
Commit
731a6940
authored
Sep 03, 2025
by
Benji Beck
Committed by
GitHub
Sep 03, 2025
Browse files
Migrate whisper inputs to TensorSchema (#23505)
Signed-off-by:
Benji Beck
<
benjibeck@meta.com
>
parent
e9b92dcd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
vllm/model_executor/models/whisper.py
vllm/model_executor/models/whisper.py
+12
-4
No files found.
vllm/model_executor/models/whisper.py
View file @
731a6940
...
...
@@ -4,7 +4,7 @@
import
math
from
collections.abc
import
Iterable
,
Mapping
,
Sequence
from
contextlib
import
nullcontext
from
typing
import
Literal
,
Optional
,
TypedDict
,
Union
,
cast
from
typing
import
Annotated
,
Literal
,
Optional
,
Union
,
cast
import
numpy
as
np
import
torch
...
...
@@ -40,6 +40,7 @@ from vllm.multimodal.processing import (BaseProcessingInfo,
PromptReplacement
,
PromptUpdate
)
from
vllm.multimodal.profiling
import
BaseDummyInputsBuilder
from
vllm.transformers_utils.processor
import
cached_get_processor
from
vllm.utils.tensor_schema
import
TensorSchema
,
TensorShape
from
.interfaces
import
(
MultiModalEmbeddings
,
SupportsMultiModal
,
SupportsTranscription
,
SupportsV0Only
)
...
...
@@ -111,9 +112,16 @@ ISO639_1_SUPPORTED_LANGS = {
}
class
WhisperAudioInputs
(
TypedDict
):
input_features
:
NestedTensors
"""Shape: `(batch_size, 128, M)`"""
class
WhisperAudioInputs
(
TensorSchema
):
"""
Dimensions:
- b: Batch size
- nmb: Number of mel bins
- t: Time frames (M)
"""
input_features
:
Annotated
[
Optional
[
NestedTensors
],
TensorShape
(
"b"
,
"nmb"
,
"t"
)]
class
WhisperPositionalEmbedding
(
nn
.
Embedding
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment