Skip to content

Commit 8b6725b

Browse files
[Misc] Update benchmark to support image_url file or http (#10287)
Signed-off-by: rbbang <[email protected]>
1 parent 1d75472 commit 8b6725b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

benchmarks/benchmark_serving.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,19 @@ def sample_hf_requests(
251251
"url": f"data:image/jpeg;base64,{image_base64}"
252252
},
253253
}
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+
}
254267
else:
255268
mm_content = None
256269

0 commit comments

Comments
 (0)