Skip to content

bugfix: missing fields in doc when using --log_samples #731

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions lmms_eval/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,7 @@ def evaluate(
target = task.doc_to_target(doc)
saved_doc = {}
for key, value in doc.items():
# If image is not in key
if "image" not in key:
# If audio is also not the value
if isinstance(value, dict) and "array" in value:
continue
else:
saved_doc[key] = value
saved_doc[key] = value
filtered_arguments = []
for req in requests:
# check if req.args is a list of tuples, and each item in the list is a serializable object
Expand Down
8 changes: 2 additions & 6 deletions lmms_eval/tasks/camerabench_vqa/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
SUFFIX_FOR_VQA = {"yes_no": "Please answer Yes or No.", "multiple_choice": "Please output the letter corresponding to the correct option."}



def get_scores(scores):
"""
Calculate various scores based on the given results.
Expand Down Expand Up @@ -148,11 +147,8 @@ def find_word_position(string, word):

def cambench_doc_to_visual(doc):
try:
default_path = os.path.join(os.getenv('HOME'), '.cache/huggingface')
load_path = os.path.expanduser(os.path.join(
os.getenv("HF_HOME", default_path),
'camerabench_vqa/datasets--chancharikm--camerabench_vqa_lmms_eval/snapshots'
))
default_path = os.path.join(os.getenv("HOME"), ".cache/huggingface")
load_path = os.path.expanduser(os.path.join(os.getenv("HF_HOME", default_path), "camerabench_vqa/datasets--chancharikm--camerabench_vqa_lmms_eval/snapshots"))

if not os.path.exists(load_path):
raise FileNotFoundError(f"Dataset path not found: {load_path}")
Expand Down