-
Notifications
You must be signed in to change notification settings - Fork 453
[Task] Add STARE Task #893
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
| def build_query(sample): | ||
| """ | ||
| Construct a multiple-choice query. Inserts <image> placeholder if missing. | ||
| Appends either chain-of-thought (CoT) or direct instruction from config. | ||
| """ | ||
| question = sample["question"] | ||
| images = sample.get("images", []) | ||
| answer = sample["answer"].strip().upper() | ||
| strategy = config["metadata"]["strategy"] | ||
|
|
||
| # Ensure <image> placeholder if images are provided | ||
| if "<image>" not in question and images: | ||
| question += "\n<image>" | ||
|
|
||
| # Fill the template with the question | ||
| prompt_template = stare_config["multi_choice_format"] | ||
| filled_prompt = prompt_template.format(question=question) | ||
|
|
||
| # Append the selected strategy instruction | ||
| if strategy == "CoT": | ||
| query = f"{filled_prompt}\n{stare_config['Strategy_Instruction']['CoT']}" | ||
| else: | ||
| query = f"{filled_prompt}\n{stare_config['Strategy_Instruction']['Directly']}" | ||
|
|
||
| # Build the result dictionary | ||
| res_dict = {"query": query, "gt_content": answer, **sample} | ||
| return res_dict |
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.
Would recommend to use doc_to_messages so that no need to put the placeholder for chat model and the images can be correctly interleaved
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 the contribution. I think most of the code looks nice. The build query should be fine to work for simple model as it is hard to come up with a unified solution with it. I would recommend you to use doc_to_messages api also so that the chat model can build the interleave format better. Feel free to refer to mmmu for more info. Thanks!
Add STARE task from https://github.com/STARE-bench/STARE/