-
Notifications
You must be signed in to change notification settings - Fork 421
easier code for multiple images #879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This extra line should be removed
| def hb_doc_to_visual(doc): | ||
| """Convert document to visual input.""" | ||
| num_image = int(os.environ.get("NUM_IMAGE", "1")) | ||
|
|
||
| if num_image == 1: | ||
| # print("one image!") | ||
| return [doc["image"].convert("RGB")] | ||
| elif num_image == 2: | ||
| # print("two images!") | ||
| return [doc["image"].convert("RGB"), doc["image"].convert("RGB")] | ||
| else: | ||
| raise ValueError(f"num_image must be 1 or 2, got {num_image}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask is the replicated images necessary for evaluating hallusionbench?
kcz358
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thank you for your contribution! I've seen that you are added some image first options in simple models such as llava ov and vllm. Though the changes are acceptable, you are more recommended to create a doc_to_messages and use the chat model for auto formatting.
Another question is that I have seen you are replicate images for many benchmarks. May I ask what are these used for?
Before you open a pull-request, please check if a similar issue already exists or has been closed before.
When you open a pull-request, please be sure to include the following
If you meet the lint warnings, you can use following scripts to reformat code.
Thank you for your contributions!