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
4c8e606b
Commit
4c8e606b
authored
Nov 28, 2024
by
zhuwenwen
Browse files
update tests
parent
77ae0f0d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
6 deletions
+18
-6
tests/entrypoints/openai/test_vision.py
tests/entrypoints/openai/test_vision.py
+12
-4
tests/models/decoder_only/vision_language/test_internvl.py
tests/models/decoder_only/vision_language/test_internvl.py
+2
-2
tests/models/decoder_only/vision_language/test_minicpmv.py
tests/models/decoder_only/vision_language/test_minicpmv.py
+1
-0
tests/prompt_adapter/__init__.py
tests/prompt_adapter/__init__.py
+0
-0
tests/prompt_adapter/test_bloom.py
tests/prompt_adapter/test_bloom.py
+1
-0
tests/prompt_adapter/test_multi_adapter_inference.py
tests/prompt_adapter/test_multi_adapter_inference.py
+1
-0
tests/prompt_adapter/test_pa_lora.py
tests/prompt_adapter/test_pa_lora.py
+1
-0
No files found.
tests/entrypoints/openai/test_vision.py
View file @
4c8e606b
...
...
@@ -12,12 +12,20 @@ from ...utils import RemoteOpenAIServer, models_path_prefix
MODEL_NAME
=
os
.
path
.
join
(
models_path_prefix
,
"microsoft/Phi-3.5-vision-instruct"
)
MAXIMUM_IMAGES
=
2
# Test different image extensions (JPG/PNG) and formats (gray/RGB/RGBA)
# TEST_IMAGE_URLS = [
# "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
# "https://upload.wikimedia.org/wikipedia/commons/f/fa/Grayscale_8bits_palette_sample_image.png",
# "https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Venn_diagram_rgb.svg/1280px-Venn_diagram_rgb.svg.png",
# "https://upload.wikimedia.org/wikipedia/commons/0/0b/RGBA_comp.png",
# ]
TEST_IMAGE_URLS
=
[
"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-
nature
-
boardwalk.jpg"
,
"https://upload.wikimedia.org/wikipedia/commons/f/fa
/Grayscale_8bits_palette_sample_image.png"
,
"https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Venn_diagram_rgb.svg
/1280px-Venn_diagram_rgb.svg.png"
,
"https://upload.wikimedia.org/wikipedia/commons/0/0b
/RGBA_comp.png"
,
os
.
path
.
join
(
models_path_prefix
,
"vision/
nature
_
boardwalk.jpg"
),
os
.
path
.
join
(
models_path_prefix
,
"vision
/Grayscale_8bits_palette_sample_image.png"
)
,
os
.
path
.
join
(
models_path_prefix
,
"vision
/1280px-Venn_diagram_rgb.svg.png"
)
,
os
.
path
.
join
(
models_path_prefix
,
"vision
/RGBA_comp.png"
)
,
]
...
...
tests/models/decoder_only/vision_language/test_internvl.py
View file @
4c8e606b
...
...
@@ -8,7 +8,7 @@ from PIL.Image import Image
from
transformers
import
AutoConfig
from
vllm.multimodal.utils
import
rescale_image_size
from
vllm.utils
import
is_cpu
from
vllm.utils
import
is_cpu
,
is_hip
from
....conftest
import
(
IMAGE_ASSETS
,
HfRunner
,
PromptImageInput
,
VllmRunner
,
_ImageAssets
)
...
...
@@ -367,7 +367,7 @@ def test_different_num_patches(hf_runner, vllm_runner, image_assets, model,
@
pytest
.
mark
.
parametrize
(
"models"
,
[(
os
.
path
.
join
(
models_path_prefix
,
"OpenGVLab/InternVL2-2B"
),
os
.
path
.
join
(
models_path_prefix
,
"OpenGVLab/InternVL2-2B-AWQ"
))])
"models"
,
[(
os
.
path
.
join
(
models_path_prefix
,
"OpenGVLab/InternVL2-2B"
),
os
.
path
.
join
(
models_path_prefix
,
"OpenGVLab/InternVL2-2B-AWQ"
)
if
not
is_hip
()
else
[]
)])
@
pytest
.
mark
.
parametrize
(
"size_factors"
,
[
...
...
tests/models/decoder_only/vision_language/test_minicpmv.py
View file @
4c8e606b
...
...
@@ -14,6 +14,7 @@ from ....conftest import IMAGE_ASSETS, HfRunner, VllmRunner
from
...utils
import
check_logprobs_close
from
....utils
import
models_path_prefix
# The image token is placed before "user" on purpose so that the test can pass
HF_IMAGE_PROMPTS
=
IMAGE_ASSETS
.
prompts
({
"stop_sign"
:
...
...
tests/prompt_adapter/__init__.py
0 → 100644
View file @
4c8e606b
tests/prompt_adapter/test_bloom.py
View file @
4c8e606b
...
...
@@ -5,6 +5,7 @@ import vllm
from
vllm.prompt_adapter.request
import
PromptAdapterRequest
from
..utils
import
models_path_prefix
MODEL_PATH
=
os
.
path
.
join
(
models_path_prefix
,
"bigscience/bloomz-560m"
)
PA_PATH
=
os
.
path
.
join
(
models_path_prefix
,
'stevhliu/bloomz-560m_PROMPT_TUNING_CAUSAL_LM'
)
...
...
tests/prompt_adapter/test_multi_adapter_inference.py
View file @
4c8e606b
...
...
@@ -3,6 +3,7 @@ from vllm.prompt_adapter.request import PromptAdapterRequest
from
..utils
import
models_path_prefix
import
os
MODEL_PATH
=
os
.
path
.
join
(
models_path_prefix
,
"bigscience/bloomz-560m"
)
pa_path
=
os
.
path
.
join
(
models_path_prefix
,
'stevhliu/bloomz-560m_PROMPT_TUNING_CAUSAL_LM'
)
pa_path2
=
os
.
path
.
join
(
models_path_prefix
,
'swapnilbp/angry_tweet_ptune'
)
...
...
tests/prompt_adapter/test_pa_lora.py
View file @
4c8e606b
...
...
@@ -6,6 +6,7 @@ from vllm.prompt_adapter.request import PromptAdapterRequest
from
..utils
import
models_path_prefix
import
os
MODEL_PATH
=
os
.
path
.
join
(
models_path_prefix
,
"meta-llama/Llama-2-7b-hf"
)
# pa_path = snapshot_download(repo_id="swapnilbp/llama_tweet_ptune")
# lora_path = snapshot_download(repo_id="yard1/llama-2-7b-sql-lora-test")
...
...
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