-
Notifications
You must be signed in to change notification settings - Fork 247
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
fix: evaluate missing splits #1268
base: main
Are you sure you want to change the base?
fix: evaluate missing splits #1268
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.
@thivyanth Thanks for taking a first stab at it! For any new functionality, we usually add a test / test cases to help confirm that the added code works. Could you please add a test for this? Specifically the following cases:
- Results exist, but no missing splits
- Results exist, and 1 missing split.
I can review the PR afterwards.
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.
Looking good, but still a few things to adjust.
if save_path.exists() and not overwrite_results: | ||
logger.info( | ||
f"{task.metadata.name} results already exists. Loading results from disk. Set overwrite_results=True to overwrite." | ||
existing_results = self.load_existing_results(save_path) |
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.
you should use
MTEBResults.from_disk(path)
to load results.
(see line 354)
logger.info( | ||
f"{task.metadata.name} results exist but missing splits: {missing_splits}. Running evaluation for missing splits." | ||
) | ||
task_eval_splits = missing_splits |
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 will overwrite the existing file further down resulting in a new file where the splits are missing. You will have to merge the results objects.
def load_existing_results(self, save_path): | ||
if save_path.exists(): | ||
with open(save_path) as f: | ||
return json.load(f) | ||
return None |
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.
def load_existing_results(self, save_path): | |
if save_path.exists(): | |
with open(save_path) as f: | |
return json.load(f) | |
return None |
not needed see comment above
def compare_splits_and_subsets(self, existing_results, task_eval_splits): | ||
missing_splits = [] | ||
for split in task_eval_splits: | ||
if split not in existing_results: | ||
missing_splits.append(split) | ||
return missing_splits |
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.
def compare_splits_and_subsets(self, existing_results, task_eval_splits): | |
missing_splits = [] | |
for split in task_eval_splits: | |
if split not in existing_results: | |
missing_splits.append(split) | |
return missing_splits | |
@staticmethod | |
def compare_splits_and_subsets(existing_results: MTEBResults, task_eval_splits: list[str]) -> list[str]: | |
missing_splits = [] | |
for split in task_eval_splits: # this will need to be adapted to MTEBResults object | |
if split not in existing_results: | |
missing_splits.append(split) | |
return missing_splits |
Addresses #1260
Checklist
@Muennighoff @isaac-chung
make test
.944 passed, 236 skipped, 55 warnings in 232.13s (0:03:52)
make lint
.