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, 07:00 UTC
[Misc] Update benchmark to support image_url file or http (#10287)
Signed-off-by: rbbang <anjaehyun87@gmail.com>
Jaehyun An committed
Nov 16, 2024 at 19:15 UTC
8b6725b0cf4ee5f363218f4bc341970c80297ccf
1 file changed
+13
benchmarks/benchmark_serving.py
+13
@@ -251,6 +251,19 @@ def sample_hf_requests(
251
"url": f"data:image/jpeg;base64,{image_base64}"
252
},
253
}
254
+ elif "image" in data and isinstance(data["image"], str):
255
+ if (data["image"].startswith("http://") or \
256
+ data["image"].startswith("file://")):
257
+ image_url = data["image"]
258
+ else:
259
+ image_url = f"file://{data['image']}"
260
+
261
+ mm_content = {
262
+ "type": "image_url",
263
+ "image_url": {
264
+ "url": image_url
265
+ },
266
+ }
267
else:
268
mm_content = None
269