Skip to content

Commit

Permalink
[Misc] Update benchmark to support image_url file or http (vllm-proje…
Browse files Browse the repository at this point in the history
…ct#10287)

Signed-off-by: rbbang <[email protected]>
  • Loading branch information
kakao-steve-ai authored Nov 16, 2024
1 parent 1d75472 commit 8b6725b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions benchmarks/benchmark_serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,19 @@ def sample_hf_requests(
"url": f"data:image/jpeg;base64,{image_base64}"
},
}
elif "image" in data and isinstance(data["image"], str):
if (data["image"].startswith("http://") or \
data["image"].startswith("file://")):
image_url = data["image"]
else:
image_url = f"file://{data['image']}"

mm_content = {
"type": "image_url",
"image_url": {
"url": image_url
},
}
else:
mm_content = None

Expand Down

0 comments on commit 8b6725b

Please sign in to comment.