mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-11 04:25:00 +08:00
[CI/Build] Replace wikipedia url with local server ones (#28908)
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
This commit is contained in:
parent
5bb1da5190
commit
896e41ae04
@ -16,6 +16,7 @@ from transformers import AutoTokenizer
|
|||||||
|
|
||||||
from vllm import version
|
from vllm import version
|
||||||
|
|
||||||
|
from ...conftest import LocalAssetServer
|
||||||
from ...utils import RemoteOpenAIServer
|
from ...utils import RemoteOpenAIServer
|
||||||
|
|
||||||
MODELS = {
|
MODELS = {
|
||||||
@ -69,7 +70,6 @@ async def client(server):
|
|||||||
|
|
||||||
|
|
||||||
_PROMPT = "Hello my name is Robert and I love magic"
|
_PROMPT = "Hello my name is Robert and I love magic"
|
||||||
_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"
|
|
||||||
|
|
||||||
|
|
||||||
def _get_expected_values(num_requests: int, prompt_ids: list[int], max_tokens: int):
|
def _get_expected_values(num_requests: int, prompt_ids: list[int], max_tokens: int):
|
||||||
@ -250,6 +250,7 @@ HIDDEN_DEPRECATED_METRICS: list[str] = [
|
|||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_metrics_exist(
|
async def test_metrics_exist(
|
||||||
|
local_asset_server: LocalAssetServer,
|
||||||
server: RemoteOpenAIServer,
|
server: RemoteOpenAIServer,
|
||||||
client: openai.AsyncClient,
|
client: openai.AsyncClient,
|
||||||
model_key: str,
|
model_key: str,
|
||||||
@ -265,13 +266,21 @@ async def test_metrics_exist(
|
|||||||
temperature=0.0,
|
temperature=0.0,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
# https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg
|
||||||
await client.chat.completions.create(
|
await client.chat.completions.create(
|
||||||
model=model_name,
|
model=model_name,
|
||||||
messages=[
|
messages=[
|
||||||
{
|
{
|
||||||
"role": "user",
|
"role": "user",
|
||||||
"content": [
|
"content": [
|
||||||
{"type": "image_url", "image_url": {"url": _IMAGE_URL}},
|
{
|
||||||
|
"type": "image_url",
|
||||||
|
"image_url": {
|
||||||
|
"url": local_asset_server.url_for(
|
||||||
|
"2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
{"type": "text", "text": "What's in this image?"},
|
{"type": "text", "text": "What's in this image?"},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user