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
38ef9488
Unverified
Commit
38ef9488
authored
Jul 16, 2024
by
Cyrus Leung
Committed by
GitHub
Jul 16, 2024
Browse files
[CI/Build] Remove "boardwalk" image asset (#6460)
parent
2bb0489c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
28 deletions
+12
-28
tests/conftest.py
tests/conftest.py
+1
-6
tests/models/test_fuyu.py
tests/models/test_fuyu.py
+4
-3
tests/models/test_llava.py
tests/models/test_llava.py
+0
-2
tests/models/test_llava_next.py
tests/models/test_llava_next.py
+0
-2
tests/models/test_paligemma.py
tests/models/test_paligemma.py
+4
-3
tests/models/test_phi3v.py
tests/models/test_phi3v.py
+0
-2
vllm/assets/image.py
vllm/assets/image.py
+3
-10
No files found.
tests/conftest.py
View file @
38ef9488
...
@@ -39,7 +39,6 @@ def _read_prompts(filename: str) -> List[str]:
...
@@ -39,7 +39,6 @@ def _read_prompts(filename: str) -> List[str]:
class
_ImageAssetPrompts
(
TypedDict
):
class
_ImageAssetPrompts
(
TypedDict
):
stop_sign
:
str
stop_sign
:
str
cherry_blossom
:
str
cherry_blossom
:
str
boardwalk
:
str
if
sys
.
version_info
<
(
3
,
9
):
if
sys
.
version_info
<
(
3
,
9
):
...
@@ -58,7 +57,6 @@ class _ImageAssets(_ImageAssetsBase):
...
@@ -58,7 +57,6 @@ class _ImageAssets(_ImageAssetsBase):
super
().
__init__
([
super
().
__init__
([
ImageAsset
(
"stop_sign"
),
ImageAsset
(
"stop_sign"
),
ImageAsset
(
"cherry_blossom"
),
ImageAsset
(
"cherry_blossom"
),
ImageAsset
(
"boardwalk"
)
])
])
def
prompts
(
self
,
prompts
:
_ImageAssetPrompts
)
->
List
[
str
]:
def
prompts
(
self
,
prompts
:
_ImageAssetPrompts
)
->
List
[
str
]:
...
@@ -68,10 +66,7 @@ class _ImageAssets(_ImageAssetsBase):
...
@@ -68,10 +66,7 @@ class _ImageAssets(_ImageAssetsBase):
The order of the returned prompts matches the order of the
The order of the returned prompts matches the order of the
assets when iterating through this object.
assets when iterating through this object.
"""
"""
return
[
return
[
prompts
[
"stop_sign"
],
prompts
[
"cherry_blossom"
]]
prompts
[
"stop_sign"
],
prompts
[
"cherry_blossom"
],
prompts
[
"boardwalk"
]
]
IMAGE_ASSETS
=
_ImageAssets
()
IMAGE_ASSETS
=
_ImageAssets
()
...
...
tests/models/test_fuyu.py
View file @
38ef9488
...
@@ -12,9 +12,10 @@ from .utils import check_logprobs_close
...
@@ -12,9 +12,10 @@ from .utils import check_logprobs_close
pytestmark
=
pytest
.
mark
.
vlm
pytestmark
=
pytest
.
mark
.
vlm
HF_IMAGE_PROMPTS
=
IMAGE_ASSETS
.
prompts
({
HF_IMAGE_PROMPTS
=
IMAGE_ASSETS
.
prompts
({
"stop_sign"
:
"What's the content of the image?
\n
"
,
# noqa: E501
"stop_sign"
:
"cherry_blossom"
:
"What is the season?
\n
"
,
"What's the content of the image?
\n
"
,
"boardwalk"
:
"What's in this image?
\n
"
,
"cherry_blossom"
:
"What is the season?
\n
"
,
})
})
models
=
[
"adept/fuyu-8b"
]
models
=
[
"adept/fuyu-8b"
]
...
...
tests/models/test_llava.py
View file @
38ef9488
...
@@ -16,8 +16,6 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
...
@@ -16,8 +16,6 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
"USER: <image>
\n
What's the content of the image?
\n
ASSISTANT:"
,
"USER: <image>
\n
What's the content of the image?
\n
ASSISTANT:"
,
"cherry_blossom"
:
"cherry_blossom"
:
"USER: <image>
\n
What is the season?
\n
ASSISTANT:"
,
"USER: <image>
\n
What is the season?
\n
ASSISTANT:"
,
"boardwalk"
:
"USER: <image>
\n
What's in this image?
\n
ASSISTANT:"
,
})
})
IMAGE_TOKEN_ID
=
32000
IMAGE_TOKEN_ID
=
32000
...
...
tests/models/test_llava_next.py
View file @
38ef9488
...
@@ -23,8 +23,6 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
...
@@ -23,8 +23,6 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
f
"
{
_PREFACE
}
USER: <image>
\n
What's the content of the image? ASSISTANT:"
,
f
"
{
_PREFACE
}
USER: <image>
\n
What's the content of the image? ASSISTANT:"
,
"cherry_blossom"
:
"cherry_blossom"
:
f
"
{
_PREFACE
}
USER: <image>
\n
What is the season? ASSISTANT:"
,
f
"
{
_PREFACE
}
USER: <image>
\n
What is the season? ASSISTANT:"
,
"boardwalk"
:
f
"
{
_PREFACE
}
USER: <image>
\n
What's in this image? ASSISTANT:"
,
})
})
IMAGE_TOKEN_ID
=
32000
IMAGE_TOKEN_ID
=
32000
...
...
tests/models/test_paligemma.py
View file @
38ef9488
...
@@ -12,9 +12,10 @@ from .utils import check_logprobs_close
...
@@ -12,9 +12,10 @@ from .utils import check_logprobs_close
pytestmark
=
pytest
.
mark
.
vlm
pytestmark
=
pytest
.
mark
.
vlm
HF_IMAGE_PROMPTS
=
IMAGE_ASSETS
.
prompts
({
HF_IMAGE_PROMPTS
=
IMAGE_ASSETS
.
prompts
({
"stop_sign"
:
"caption es"
,
"stop_sign"
:
"cherry_blossom"
:
"What is in the picture?"
,
"caption es"
,
"boardwalk"
:
"What is in the picture?"
,
"cherry_blossom"
:
"What is in the picture?"
,
})
})
IMAGE_TOKEN_ID
=
257152
IMAGE_TOKEN_ID
=
257152
...
...
tests/models/test_phi3v.py
View file @
38ef9488
...
@@ -18,8 +18,6 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
...
@@ -18,8 +18,6 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
"<|user|>
\n
<|image_1|>
\n
What's the content of the image?<|end|>
\n
<|assistant|>
\n
"
,
# noqa: E501
"<|user|>
\n
<|image_1|>
\n
What's the content of the image?<|end|>
\n
<|assistant|>
\n
"
,
# noqa: E501
"cherry_blossom"
:
"cherry_blossom"
:
"<|user|>
\n
<|image_1|>
\n
What is the season?<|end|>
\n
<|assistant|>
\n
"
,
"<|user|>
\n
<|image_1|>
\n
What is the season?<|end|>
\n
<|assistant|>
\n
"
,
"boardwalk"
:
"<|user|>
\n
<|image_1|>
\n
What's in this image?<|end|>
\n
<|assistant|>
\n
"
,
})
})
models
=
[
"microsoft/Phi-3-vision-128k-instruct"
]
models
=
[
"microsoft/Phi-3-vision-128k-instruct"
]
...
...
vllm/assets/image.py
View file @
38ef9488
import
shutil
import
shutil
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
from
functools
import
cached_property
,
lru_cache
from
functools
import
lru_cache
from
typing
import
Literal
from
typing
import
Literal
import
requests
import
requests
from
PIL
import
Image
from
PIL
import
Image
from
vllm.multimodal.utils
import
fetch_image
from
.base
import
get_cache_dir
from
.base
import
get_cache_dir
...
@@ -35,13 +33,8 @@ def get_air_example_data_2_asset(filename: str) -> Image.Image:
...
@@ -35,13 +33,8 @@ def get_air_example_data_2_asset(filename: str) -> Image.Image:
@
dataclass
(
frozen
=
True
)
@
dataclass
(
frozen
=
True
)
class
ImageAsset
:
class
ImageAsset
:
name
:
Literal
[
"stop_sign"
,
"cherry_blossom"
,
"boardwalk"
]
name
:
Literal
[
"stop_sign"
,
"cherry_blossom"
]
@
cached_
property
@
property
def
pil_image
(
self
)
->
Image
.
Image
:
def
pil_image
(
self
)
->
Image
.
Image
:
if
self
.
name
==
"boardwalk"
:
return
fetch_image
(
"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
)
return
get_air_example_data_2_asset
(
f
"
{
self
.
name
}
.jpg"
)
return
get_air_example_data_2_asset
(
f
"
{
self
.
name
}
.jpg"
)
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