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
BLEURT: Match key names to correspond with filename #3348
Conversation
In order to properly locate downloaded ckpt files key name needs to match filename
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.
Thanks for pointing that out !
Maybe to avoid a breaking change we can just consider self.config_name.lower()
? This way both upper case and lower case will work
Thanks for the suggestion! I think the current checked-in
inspecting specified path I see that directory name is |
Indeed, good catch ! Your solution that fixes Furthermore to avoid breaking changes though we could also keep the support for the lowercase one: if self.config_name.lower() in CHECKPOINT_URLS:
checkpoint_name = self.config_name.lower()
elif self.config_name.upper() in CHECKPOINT_URLS:
checkpoint_name = self.config_name.upper()
else:
raise KeyError(
f"{self.config_name} model not found. You should supply the name of a model checkpoint for bleurt in {CHECKPOINT_URLS.keys()}"
) and then we can use model_path = dl_manager.download_and_extract(CHECKPOINT_URLS[checkpoint_name])
self.scorer = score.BleurtScorer(os.path.join(model_path, checkpoint_name)) Please let me know if that sounds reasonable to you ! |
Thanks for the suggestion! I believe your suggestion should work to make keys case insensitive. Changes are committed to the PR now. |
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.
Thanks !
In order to properly locate downloaded ckpt files key name needs to match filename. Correcting change introduced in #3235