A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 20:45 UTC
[CI/Build] Remove "boardwalk" image asset (#6460)
Cyrus Leung committed
Jul 16, 2024 at 23:59 UTC
38ef94888afc0c2bccc2f18422d2b525d7649ac3
7 files changed
+12
-28
tests/conftest.py
+1
-6
@@ -39,7 +39,6 @@ def _read_prompts(filename: str) -> List[str]:
39
class _ImageAssetPrompts(TypedDict):
40
stop_sign: str
41
cherry_blossom: str
42
- boardwalk: str
42
43
44
if sys.version_info < (3, 9):
@@ -58,7 +57,6 @@ class _ImageAssets(_ImageAssetsBase):
57
super().__init__([
58
ImageAsset("stop_sign"),
59
ImageAsset("cherry_blossom"),
61
- ImageAsset("boardwalk")
60
])
61
62
def prompts(self, prompts: _ImageAssetPrompts) -> List[str]:
@@ -68,10 +66,7 @@ class _ImageAssets(_ImageAssetsBase):
66
The order of the returned prompts matches the order of the
67
assets when iterating through this object.
68
"""
71
- return [
72
- prompts["stop_sign"], prompts["cherry_blossom"],
73
- prompts["boardwalk"]
74
- ]
69
+ return [prompts["stop_sign"], prompts["cherry_blossom"]]
70
71
72
IMAGE_ASSETS = _ImageAssets()
tests/models/test_fuyu.py
+4
-3
@@ -12,9 +12,10 @@ from .utils import check_logprobs_close
12
pytestmark = pytest.mark.vlm
13
14
HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
15
- "stop_sign": "What's the content of the image?\n", # noqa: E501
16
- "cherry_blossom": "What is the season?\n",
17
- "boardwalk": "What's in this image?\n",
15
+ "stop_sign":
16
+ "What's the content of the image?\n",
17
+ "cherry_blossom":
18
+ "What is the season?\n",
19
})
20
21
models = ["adept/fuyu-8b"]
tests/models/test_llava.py
-2
@@ -16,8 +16,6 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
16
"USER: <image>\nWhat's the content of the image?\nASSISTANT:",
17
"cherry_blossom":
18
"USER: <image>\nWhat is the season?\nASSISTANT:",
19
- "boardwalk":
20
- "USER: <image>\nWhat's in this image?\nASSISTANT:",
19
})
20
21
IMAGE_TOKEN_ID = 32000
tests/models/test_llava_next.py
-2
@@ -23,8 +23,6 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
23
f"{_PREFACE} USER: <image>\nWhat's the content of the image? ASSISTANT:",
24
"cherry_blossom":
25
f"{_PREFACE} USER: <image>\nWhat is the season? ASSISTANT:",
26
- "boardwalk":
27
- f"{_PREFACE} USER: <image>\nWhat's in this image? ASSISTANT:",
26
})
27
28
IMAGE_TOKEN_ID = 32000
tests/models/test_paligemma.py
+4
-3
@@ -12,9 +12,10 @@ from .utils import check_logprobs_close
12
pytestmark = pytest.mark.vlm
13
14
HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
15
- "stop_sign": "caption es",
16
- "cherry_blossom": "What is in the picture?",
17
- "boardwalk": "What is in the picture?",
15
+ "stop_sign":
16
+ "caption es",
17
+ "cherry_blossom":
18
+ "What is in the picture?",
19
})
20
21
IMAGE_TOKEN_ID = 257152
tests/models/test_phi3v.py
-2
@@ -18,8 +18,6 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts({
18
"<|user|>\n<|image_1|>\nWhat's the content of the image?<|end|>\n<|assistant|>\n", # noqa: E501
19
"cherry_blossom":
20
"<|user|>\n<|image_1|>\nWhat is the season?<|end|>\n<|assistant|>\n",
21
- "boardwalk":
22
- "<|user|>\n<|image_1|>\nWhat's in this image?<|end|>\n<|assistant|>\n",
21
})
22
23
models = ["microsoft/Phi-3-vision-128k-instruct"]
vllm/assets/image.py
+3
-10
@@ -1,13 +1,11 @@
1
import shutil
2
from dataclasses import dataclass
3
-from functools import cached_property, lru_cache
3
+from functools import lru_cache
4
from typing import Literal
5
6
import requests
7
from PIL import Image
8
9
-from vllm.multimodal.utils import fetch_image
10
-
9
from .base import get_cache_dir
10
11
@@ -35,13 +33,8 @@ def get_air_example_data_2_asset(filename: str) -> Image.Image:
33
34
@dataclass(frozen=True)
35
class ImageAsset:
38
- name: Literal["stop_sign", "cherry_blossom", "boardwalk"]
36
+ name: Literal["stop_sign", "cherry_blossom"]
37
40
- @cached_property
38
+ @property
39
def pil_image(self) -> Image.Image:
42
- if self.name == "boardwalk":
43
- return fetch_image(
44
- "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
45
- )
46
-
40
return get_air_example_data_2_asset(f"{self.name}.jpg")