Repository navigation
fix(eval): load MSMARCO remote qrels when dataset_dir is not set - #1605
Open
MohammadHijjawi97 wants to merge 1 commit into
Open
MohammadHijjawi97 wants to merge 1 commit into
MohammadHijjawi97 wants to merge 1 commit into
Conversation
When no dataset_dir is given, MSMARCOEvalDataLoader._load_remote_qrels reads qrels without saving them, but the check on qrels_save_path was inverted. For the dl19/dl20 splits (and document dev) it skipped the downloaded TREC file and iterated the undefined HF `qrels`, raising UnboundLocalError; for passage dev it tried to open(None). Flip the condition to match the save_dir branch and add a regression test that mocks the download.
This branch has not been deployed
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.
Problem
When MSMARCO evaluation is run without
--dataset_dir(documented as "the dataset will be only downloaded to the cache directory"),MSMARCOEvalDataLoader._load_remote_qrelstakes the branch that reads qrels without saving them. The check there is inverted (if qrels_save_path is None:), so:dl19/dl20(passage and document) and documentdev, the downloaded TREC qrels file is skipped and the code iterates the HFqrelsvariable that was never assigned:UnboundLocalError: cannot access local variable 'qrels'dev, it callsopen(None):TypeErrorFix
Flip the condition to
if qrels_save_path is not None:, matching thesave_dirbranch just above it.Tests
Added
tests/test_msmarco_data_loader.py, which mocks_download_filewith a tiny TREC-style qrels file (no network) and checksload_qrelsfor passage/document x dl19/dl20.UnboundLocalError)pytest tests/test_msmarco_data_loader.py