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 14, 05:30 UTC
[CI/Build] Use vLLM client's user agent to fetch images (#23561)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Aug 26, 2025 at 10:34 UTC
6fd45e7b8a3dc216875428835036a9008cdc0fe3
2 files changed
+3
-6
tests/entrypoints/openai/test_vision.py
+2
-4
@@ -6,8 +6,6 @@ import json
6
import openai
7
import pytest
8
import pytest_asyncio
9
-import requests
10
-from PIL import Image
9
from transformers import AutoProcessor
10
11
from vllm.multimodal.utils import encode_image_base64, fetch_image
@@ -36,7 +34,7 @@ EXPECTED_MM_BEAM_SEARCH_RES = [
34
],
35
[
36
"The image shows a Venn diagram with three over",
39
- "The image shows a Venn diagram with three intersect",
37
+ "This image shows a Venn diagram with three intersect",
38
],
39
[
40
"This image displays a gradient of colors ranging from",
@@ -88,7 +86,7 @@ def get_hf_prompt_tokens(model_name, content, image_url):
86
"role": "user",
87
"content": f"{placeholder}{content}",
88
}]
91
- images = [Image.open(requests.get(image_url, stream=True).raw)]
89
+ images = [fetch_image(image_url)]
90
91
prompt = processor.tokenizer.apply_chat_template(
92
messages, tokenize=False, add_generation_prompt=True)
tests/entrypoints/openai/test_vision_embedding.py
+1
-2
@@ -5,7 +5,6 @@ import json
5
6
import pytest
7
import requests
8
-from PIL import Image
8
from transformers import AutoProcessor
9
10
from vllm.entrypoints.openai.protocol import EmbeddingResponse
@@ -64,7 +63,7 @@ def get_hf_prompt_tokens(model_name, content, image_url):
63
64
placeholder = "<|image_1|> "
65
prompt = f"{placeholder}{content}"
67
- images = [Image.open(requests.get(image_url, stream=True).raw)]
66
+ images = [fetch_image(image_url)]
67
inputs = processor(prompt, images, return_tensors="pt")
68
return inputs.input_ids.shape[1]
69