Unverified Commit 8b6725b0 authored by Jaehyun An's avatar Jaehyun An Committed by GitHub
Browse files

[Misc] Update benchmark to support image_url file or http (#10287)


Signed-off-by: default avatarrbbang <anjaehyun87@gmail.com>
parent 1d754726
...@@ -251,6 +251,19 @@ def sample_hf_requests( ...@@ -251,6 +251,19 @@ def sample_hf_requests(
"url": f"data:image/jpeg;base64,{image_base64}" "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: else:
mm_content = None mm_content = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment