Skip to content

Commit 8eb35c5

Browse files
khluucodex
andauthored
[CI] Mirror external test assets in vLLM S3 (#52064)
Signed-off-by: khluu <khluu000@gmail.com> Co-authored-by: OpenAI Codex <noreply@openai.com>
1 parent b369f10 commit 8eb35c5

5 files changed

Lines changed: 30 additions & 41 deletions

File tree

tests/entrypoints/multimodal/openai/chat_completion/test_video.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
import pytest_asyncio
99

1010
from tests.utils import RemoteOpenAIServer
11+
from vllm.assets.base import VLLM_S3_BUCKET_URL
1112
from vllm.multimodal.utils import encode_video_url, fetch_video
1213
from vllm.platforms import current_platform
1314

1415
MODEL_NAME = "llava-hf/llava-onevision-qwen2-0.5b-ov-hf"
1516
MAXIMUM_VIDEOS = 3
1617

1718
TEST_VIDEO_URLS = [
18-
"https://www.bogotobogo.com/python/OpenCV_Python/images/mean_shift_tracking/slow_traffic_small.mp4",
19-
"https://github.com/opencv/opencv/raw/refs/tags/4.12.0/samples/data/vtest.avi",
20-
"https://github.com/opencv/opencv/raw/refs/tags/4.12.0/samples/data/Megamind.avi",
19+
f"{VLLM_S3_BUCKET_URL}/multimodal_asset/slow_traffic_small.mp4",
20+
f"{VLLM_S3_BUCKET_URL}/multimodal_asset/vtest.avi",
21+
f"{VLLM_S3_BUCKET_URL}/multimodal_asset/Megamind.avi",
2122
]
2223

2324

tests/entrypoints/pooling/classify/test_online_vision.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import requests
77

88
from tests.utils import RemoteOpenAIServer
9+
from vllm.assets.base import VLLM_S3_BUCKET_URL
910
from vllm.entrypoints.pooling.classify.protocol import ClassificationResponse
1011
from vllm.multimodal.utils import encode_image_url, fetch_image
1112

@@ -14,9 +15,9 @@
1415

1516
HF_OVERRIDES = {"architectures": ["Qwen2_5_VLForSequenceClassification"]}
1617
input_text = "This product was excellent and exceeded my expectations"
17-
image_url = "https://vllm-public-assets.s3.us-west-2.amazonaws.com/multimodal_asset/cat_snow.jpg"
18+
image_url = f"{VLLM_S3_BUCKET_URL}/multimodal_asset/cat_snow.jpg"
1819
image_base64 = {"url": encode_image_url(fetch_image(image_url))}
19-
video_url = "https://www.bogotobogo.com/python/OpenCV_Python/images/mean_shift_tracking/slow_traffic_small.mp4"
20+
video_url = f"{VLLM_S3_BUCKET_URL}/multimodal_asset/slow_traffic_small.mp4"
2021

2122

2223
@pytest.fixture(scope="module")

tests/evals/gsm8k/gsm8k_eval.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import requests
2121
from tqdm.asyncio import tqdm
2222

23+
from vllm.assets.base import VLLM_S3_BUCKET_URL
24+
2325
INVALID = -9999999
2426

2527

@@ -44,8 +46,8 @@ def download_and_cache_file(url: str, filename: str | None = None) -> str:
4446

4547
def load_gsm8k_data() -> tuple[list[dict], list[dict]]:
4648
"""Load GSM8K train and test data"""
47-
train_url = "https://raw.githubusercontent.com/openai/grade-school-math/master/grade_school_math/data/train.jsonl"
48-
test_url = "https://raw.githubusercontent.com/openai/grade-school-math/master/grade_school_math/data/test.jsonl"
49+
train_url = f"{VLLM_S3_BUCKET_URL}/ci-datasets/gsm8k/train.jsonl"
50+
test_url = f"{VLLM_S3_BUCKET_URL}/ci-datasets/gsm8k/test.jsonl"
4951

5052
train_file = download_and_cache_file(train_url)
5153
test_file = download_and_cache_file(test_url)

tests/models/multimodal/pooling/test_jinavl_reranker.py

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from packaging import version
77
from transformers import AutoModel
88

9+
from vllm.assets.base import VLLM_S3_BUCKET_URL
910
from vllm.entrypoints.chat_utils import (
1011
ChatCompletionContentPartImageEmbedsParam,
1112
ChatCompletionContentPartImageParam,
@@ -34,6 +35,11 @@
3435
"model.": "model.language_model.",
3536
}
3637

38+
HANDELSBLATT_IMAGE_URL = (
39+
f"{VLLM_S3_BUCKET_URL}/multimodal_asset/jinavl-handelsblatt-preview.png"
40+
)
41+
PAPER_IMAGE_URL = f"{VLLM_S3_BUCKET_URL}/multimodal_asset/jinavl-paper-11.png"
42+
3743
# Shared long text for test data
3844
LONG_TEXT_DOC = """We present ReaderLM-v2, a compact 1.5 billion parameter language model designed for efficient
3945
web content extraction. Our model processes documents up to 512K tokens, transforming messy HTML
@@ -50,12 +56,8 @@
5056
TEXT_IMAGE_TEST_DATA = {
5157
"query": [{"text": "slm markdown"}],
5258
"documents": [
53-
{
54-
"image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png"
55-
},
56-
{
57-
"image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
58-
},
59+
{"image": HANDELSBLATT_IMAGE_URL},
60+
{"image": PAPER_IMAGE_URL},
5961
],
6062
}
6163

@@ -68,44 +70,28 @@
6870
}
6971

7072
IMAGE_TEXT_TEST_DATA = {
71-
"query": [
72-
{
73-
"image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
74-
}
75-
],
73+
"query": [{"image": PAPER_IMAGE_URL}],
7674
"documents": [
7775
{"text": LONG_TEXT_DOC},
7876
{"text": "数据提取么?为什么不用正则啊,你用正则不就全解决了么?"},
7977
],
8078
}
8179

8280
IMAGE_IMAGE_TEST_DATA = {
83-
"query": [
84-
{
85-
"image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
86-
}
87-
],
81+
"query": [{"image": PAPER_IMAGE_URL}],
8882
"documents": [
89-
{
90-
"image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png"
91-
},
92-
{
93-
"image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
94-
},
83+
{"image": HANDELSBLATT_IMAGE_URL},
84+
{"image": PAPER_IMAGE_URL},
9585
],
9686
}
9787

9888
TEXT_MIXED_DOCS_TEST_DATA = {
9989
"query": [{"text": "slm markdown"}],
10090
"documents": [
10191
{"text": LONG_TEXT_DOC},
102-
{
103-
"image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
104-
},
92+
{"image": PAPER_IMAGE_URL},
10593
{"text": "数据提取么?为什么不用正则啊,你用正则不就全解决了么?"},
106-
{
107-
"image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png"
108-
},
94+
{"image": HANDELSBLATT_IMAGE_URL},
10995
],
11096
}
11197

tests/multimodal/media/test_connector.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import torch
1818
from PIL import Image, ImageChops
1919

20+
from vllm.assets.base import VLLM_S3_BUCKET_URL
2021
from vllm.multimodal.image import convert_image_mode
2122
from vllm.multimodal.inputs import PlaceholderRange
2223
from vllm.multimodal.media import MediaConnector
@@ -30,8 +31,8 @@
3031
]
3132

3233
TEST_VIDEO_URLS = [
33-
"https://www.bogotobogo.com/python/OpenCV_Python/images/mean_shift_tracking/slow_traffic_small.mp4",
34-
"https://github.com/opencv/opencv/raw/refs/tags/4.12.0/samples/data/vtest.avi",
34+
f"{VLLM_S3_BUCKET_URL}/multimodal_asset/slow_traffic_small.mp4",
35+
f"{VLLM_S3_BUCKET_URL}/multimodal_asset/vtest.avi",
3536
]
3637

3738

@@ -76,8 +77,7 @@ async def test_fetch_image_base64(
7677
connector = MediaConnector(
7778
# Domain restriction should not apply to data URLs.
7879
allowed_media_domains=[
79-
"www.bogotobogo.com",
80-
"github.com",
80+
VLLM_S3_BUCKET_URL.removeprefix("https://"),
8181
]
8282
)
8383
url_image = url_images[raw_image_url]
@@ -390,8 +390,7 @@ async def test_allowed_media_domains(video_url: str, num_frames: int):
390390
}
391391
},
392392
allowed_media_domains=[
393-
"www.bogotobogo.com",
394-
"github.com",
393+
VLLM_S3_BUCKET_URL.removeprefix("https://"),
395394
],
396395
)
397396

0 commit comments

Comments
 (0)