Skip to content

Commit 896e41a

Browse files
authored
[CI/Build] Replace wikipedia url with local server ones (#28908)
Signed-off-by: Isotr0py <[email protected]>
1 parent 5bb1da5 commit 896e41a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/entrypoints/openai/test_metrics.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from vllm import version
1818

19+
from ...conftest import LocalAssetServer
1920
from ...utils import RemoteOpenAIServer
2021

2122
MODELS = {
@@ -69,7 +70,6 @@ async def client(server):
6970

7071

7172
_PROMPT = "Hello my name is Robert and I love magic"
72-
_IMAGE_URL = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
7373

7474

7575
def _get_expected_values(num_requests: int, prompt_ids: list[int], max_tokens: int):
@@ -250,6 +250,7 @@ async def test_metrics_counts(
250250

251251
@pytest.mark.asyncio
252252
async def test_metrics_exist(
253+
local_asset_server: LocalAssetServer,
253254
server: RemoteOpenAIServer,
254255
client: openai.AsyncClient,
255256
model_key: str,
@@ -265,13 +266,21 @@ async def test_metrics_exist(
265266
temperature=0.0,
266267
)
267268
else:
269+
# https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg
268270
await client.chat.completions.create(
269271
model=model_name,
270272
messages=[
271273
{
272274
"role": "user",
273275
"content": [
274-
{"type": "image_url", "image_url": {"url": _IMAGE_URL}},
276+
{
277+
"type": "image_url",
278+
"image_url": {
279+
"url": local_asset_server.url_for(
280+
"2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
281+
),
282+
},
283+
},
275284
{"type": "text", "text": "What's in this image?"},
276285
],
277286
}

0 commit comments

Comments
 (0)