fix(tasks): utils improvements across 7 benchmarks#1386
Open
Luodian wants to merge 2 commits into
Open
Conversation
Port generic, self-contained task-utils improvements: - egoschema: fix the HF_HOME cache path; replace the unbounded submission retry loop with a bounded, backed-off POST to EgoSchema's public validation server that fails loudly on persistent failure; return the accuracy from the aggregators; add deterministic generation_kwargs; and document offline (subset) vs submission-only (full set) scoring. - erqa: use the shared extract_mcq_answer helper, add a doc_to_messages builder that interleaves images before text, drop the dead local answer extractor and unused config load; add unit tests. - vsibench: robust numeric-answer extraction (bare digits, digits in a sentence, and English number words, first token wins) for NA questions. - vsisuper: harden _abs_dist_norm (float coercion, divide-by-zero guard) and _parse_prediction_list (safe JSON parse, list guard) in the count_streaming task. - mmsi_video: add a single-visual-input subset (Cambrian-P MMSI-Video protocol) via process_docs_single_input_only; drop unused imports. - tomato: make the OpenAI import lazy so it is only needed for the (disabled) GPT parser, and stop hardcoding a 16-frame assumption in the prompt so the model's own num_frames governs frame count. - videoevalpro: guard the score aggregator against an unknown task_type (previously a KeyError) and use identity comparison for the judge flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Generic, self-contained improvements to seven evaluation task utilities. No new dependencies; all data still loads from the existing public Hugging Face datasets.
Changes
HF_HOMEcache path (~/.cache/huggingface, not.../hub). Replace the unbounded submission retry loop with a bounded, backed-off POST to EgoSchema's public validation server that saves the submission first and fails loudly on persistent failure instead of spinning forever or recording a bogus 0. Return the parsed accuracy from the MC / MC_PPL aggregators. Add deterministicgeneration_kwargs. README now spells out which tasks score offline (the N=500 subset) vs. which are submission-only (the full set) — and the offline subset tasks (egoschema_subset,egoschema_subset_mcppl) no longer declare the serversubmissionmetric at all: they have real answers and score locally, so an offline/no-egress node can't crash on the (now loud) server POST. The full-set tasks keep server submission.extract_mcq_answerhelper, add adoc_to_messagesbuilder that interleaves images before the question text, and remove the dead local extractor / unused template load. Adds unit tests.twenty-one,three hundred and twenty-one), with the first number token winning._abs_dist_normnow coerces to float and guards divide-by-zero, and_parse_prediction_listtolerates malformed / non-list JSON. Scoring note: this corrects a bug where malformed predictions and zero-valued targets scored a perfect MRA (the oldexcept: return 0.0fed the "distance" side); they now score worst-case, so affected historical count_streaming numbers will drop.mmsi_video_single_input) matching Cambrian-P's reported MMSI-Video protocol, and drop unused imports.num_framesgoverns the frame budget.task_type(previously aKeyError) and use identity comparison for the judge flag.Validation
py_compile,ruff check,black --check(line-length 240), andisort --profile black --checkall pass on the changed files.!functionutilities exist.erqa/tests/test_erqa_utils.pycovers answer extraction, message interleaving, and aggregate accuracy.TaskManagerresolvesegoschema_subset/egoschema_subset_mcpplwithmetric_list=['score']and the fullegoschema/egoschema_mcpplstill with['submission'], no network access.Review pass (2026-07-06)
Self-review follow-up commit removes the
submissionmetric from the two offline subset yamls (see egoschema bullet) — previously the README recommended the subset for offline eval while its submission metric still POSTed to the validation server and, after this PR's own retry hardening, would have raised on a no-egress node before the offlinescorewas emitted.