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
d7543862
Unverified
Commit
d7543862
authored
May 02, 2025
by
Cyrus Leung
Committed by
GitHub
May 02, 2025
Browse files
[Misc] Rename assets for testing (#17575)
Signed-off-by:
DarkLight1337
<
tlleungac@connect.ust.hk
>
parent
c777df79
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
38 additions
and
19 deletions
+38
-19
tests/models/multimodal/processing/test_phi3v.py
tests/models/multimodal/processing/test_phi3v.py
+2
-2
tests/models/multimodal/processing/test_phi4mm.py
tests/models/multimodal/processing/test_phi4mm.py
+2
-2
tests/models/multimodal/processing/test_qwen2_vl.py
tests/models/multimodal/processing/test_qwen2_vl.py
+2
-2
tests/models/multimodal/processing/test_smolvlm.py
tests/models/multimodal/processing/test_smolvlm.py
+2
-2
tests/models/quantization/test_awq.py
tests/models/quantization/test_awq.py
+2
-2
vllm/assets/audio.py
vllm/assets/audio.py
+9
-3
vllm/assets/image.py
vllm/assets/image.py
+3
-1
vllm/assets/video.py
vllm/assets/video.py
+16
-5
No files found.
tests/models/multimodal/processing/test_phi3v.py
View file @
d7543862
...
...
@@ -4,7 +4,7 @@ import pytest
from
vllm.multimodal
import
MULTIMODAL_REGISTRY
from
....conftest
import
_
ImageAssets
from
....conftest
import
Image
Test
Assets
from
...utils
import
build_model_context
...
...
@@ -22,7 +22,7 @@ from ...utils import build_model_context
@
pytest
.
mark
.
parametrize
(
"num_imgs"
,
[
1
,
2
])
@
pytest
.
mark
.
parametrize
(
"kwargs_on_init"
,
[
True
,
False
])
def
test_processor_override
(
image_assets
:
_
ImageAssets
,
image_assets
:
Image
Test
Assets
,
model_id
:
str
,
mm_processor_kwargs
:
dict
[
str
,
int
],
expected_toks_per_img
:
int
,
...
...
tests/models/multimodal/processing/test_phi4mm.py
View file @
d7543862
...
...
@@ -4,7 +4,7 @@ import pytest
from
vllm.multimodal
import
MULTIMODAL_REGISTRY
from
....conftest
import
_
ImageAssets
from
....conftest
import
Image
Test
Assets
from
...utils
import
build_model_context
...
...
@@ -22,7 +22,7 @@ from ...utils import build_model_context
@
pytest
.
mark
.
parametrize
(
"num_imgs"
,
[
1
,
2
])
@
pytest
.
mark
.
parametrize
(
"kwargs_on_init"
,
[
True
,
False
])
def
test_processor_override
(
image_assets
:
_
ImageAssets
,
image_assets
:
Image
Test
Assets
,
model_id
:
str
,
mm_processor_kwargs
:
dict
[
str
,
int
],
expected_toks_per_img
:
int
,
...
...
tests/models/multimodal/processing/test_qwen2_vl.py
View file @
d7543862
...
...
@@ -4,7 +4,7 @@ import pytest
from
vllm.multimodal
import
MULTIMODAL_REGISTRY
from
....conftest
import
_
ImageAssets
from
....conftest
import
Image
Test
Assets
from
...utils
import
build_model_context
...
...
@@ -19,7 +19,7 @@ from ...utils import build_model_context
@
pytest
.
mark
.
parametrize
(
"num_imgs"
,
[
1
,
2
])
@
pytest
.
mark
.
parametrize
(
"kwargs_on_init"
,
[
True
,
False
])
def
test_processor_override
(
image_assets
:
_
ImageAssets
,
image_assets
:
Image
Test
Assets
,
model_id
:
str
,
mm_processor_kwargs
:
dict
[
str
,
object
],
expected_toks_per_img
:
int
,
...
...
tests/models/multimodal/processing/test_smolvlm.py
View file @
d7543862
...
...
@@ -5,7 +5,7 @@ from transformers import SmolVLMConfig
from
vllm.multimodal
import
MULTIMODAL_REGISTRY
from
....conftest
import
_
ImageAssets
from
....conftest
import
Image
Test
Assets
from
...utils
import
build_model_context
...
...
@@ -21,7 +21,7 @@ from ...utils import build_model_context
@
pytest
.
mark
.
parametrize
(
"num_imgs"
,
[
1
,
2
])
@
pytest
.
mark
.
parametrize
(
"kwargs_on_init"
,
[
True
,
False
])
def
test_processor_override
(
image_assets
:
_
ImageAssets
,
image_assets
:
Image
Test
Assets
,
model_id
:
str
,
mm_processor_kwargs
:
dict
[
str
,
object
],
expected_toks_per_img
:
int
,
...
...
tests/models/quantization/test_awq.py
View file @
d7543862
...
...
@@ -7,7 +7,7 @@ import torch
from
vllm.multimodal.image
import
rescale_image_size
from
...conftest
import
IMAGE_ASSETS
,
VllmRunner
,
_
ImageAssets
from
...conftest
import
IMAGE_ASSETS
,
Image
Test
Assets
,
VllmRunner
from
..utils
import
check_logprobs_close
HF_IMAGE_PROMPTS
=
IMAGE_ASSETS
.
prompts
({
...
...
@@ -20,7 +20,7 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
def
run_awq_test
(
vllm_runner
:
type
[
VllmRunner
],
image_assets
:
_
ImageAssets
,
image_assets
:
Image
Test
Assets
,
source_model
:
str
,
quant_model
:
str
,
*
,
...
...
vllm/assets/audio.py
View file @
d7543862
...
...
@@ -18,19 +18,25 @@ except ImportError:
ASSET_DIR
=
"multimodal_asset"
AudioAssetName
=
Literal
[
"winning_call"
,
"mary_had_lamb"
]
@
dataclass
(
frozen
=
True
)
class
AudioAsset
:
name
:
Literal
[
"winning_call"
,
"mary_had_lamb"
]
name
:
AudioAssetName
@
property
def
filename
(
self
)
->
str
:
return
f
"
{
self
.
name
}
.ogg"
@
property
def
audio_and_sample_rate
(
self
)
->
tuple
[
npt
.
NDArray
,
float
]:
audio_path
=
get_vllm_public_assets
(
filename
=
f
"
{
self
.
name
}
.ogg"
,
audio_path
=
get_vllm_public_assets
(
filename
=
self
.
file
name
,
s3_prefix
=
ASSET_DIR
)
return
librosa
.
load
(
audio_path
,
sr
=
None
)
def
get_local_path
(
self
)
->
Path
:
return
get_vllm_public_assets
(
filename
=
f
"
{
self
.
name
}
.ogg"
,
return
get_vllm_public_assets
(
filename
=
self
.
file
name
,
s3_prefix
=
ASSET_DIR
)
@
property
...
...
vllm/assets/image.py
View file @
d7543862
...
...
@@ -10,10 +10,12 @@ from .base import get_vllm_public_assets
VLM_IMAGES_DIR
=
"vision_model_images"
ImageAssetName
=
Literal
[
"stop_sign"
,
"cherry_blossom"
]
@
dataclass
(
frozen
=
True
)
class
ImageAsset
:
name
:
Literal
[
"stop_sign"
,
"cherry_blossom"
]
name
:
ImageAssetName
@
property
def
pil_image
(
self
)
->
Image
.
Image
:
...
...
vllm/assets/video.py
View file @
d7543862
...
...
@@ -2,7 +2,7 @@
from
dataclasses
import
dataclass
from
functools
import
lru_cache
from
typing
import
Literal
,
Optional
from
typing
import
ClassVar
,
Literal
,
Optional
import
cv2
import
numpy
as
np
...
...
@@ -76,20 +76,31 @@ def video_to_pil_images_list(path: str,
]
VideoAssetName
=
Literal
[
"baby_reading"
]
@
dataclass
(
frozen
=
True
)
class
VideoAsset
:
name
:
Literal
[
"sample_demo_1"
]
name
:
VideoAssetName
num_frames
:
int
=
-
1
_NAME_TO_FILE
:
ClassVar
[
dict
[
VideoAssetName
,
str
]]
=
{
"baby_reading"
:
"sample_demo_1.mp4"
,
}
@
property
def
filename
(
self
)
->
str
:
return
self
.
_NAME_TO_FILE
[
self
.
name
]
@
property
def
pil_images
(
self
)
->
list
[
Image
.
Image
]:
video_path
=
download_video_asset
(
self
.
name
+
".mp4"
)
video_path
=
download_video_asset
(
self
.
file
name
)
ret
=
video_to_pil_images_list
(
video_path
,
self
.
num_frames
)
return
ret
@
property
def
np_ndarrays
(
self
)
->
npt
.
NDArray
:
video_path
=
download_video_asset
(
self
.
name
+
".mp4"
)
video_path
=
download_video_asset
(
self
.
file
name
)
ret
=
video_to_ndarrays
(
video_path
,
self
.
num_frames
)
return
ret
...
...
@@ -99,5 +110,5 @@ class VideoAsset:
See also: examples/offline_inference/qwen2_5_omni/only_thinker.py
"""
video_path
=
download_video_asset
(
self
.
name
+
".mp4"
)
video_path
=
download_video_asset
(
self
.
file
name
)
return
librosa
.
load
(
video_path
,
sr
=
sampling_rate
)[
0
]
Prev
1
2
Next
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