Skip to content
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

Removing model_types from utils.py #58

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

dougian
Copy link
Contributor

@dougian dougian commented Jun 5, 2020

Hey, looks like the library is currently broken when installed with the latest versions of everything.

Since the latest release in transformers (more specifically, since this commit huggingface/transformers@d4c2cb4) the config maps (pretrained_config_archive_map) do not exist.

This means that bertscore right now fails when used with the latest version of transformers, which it will pull when installing locally.

e.g, when running the unittests:

ERROR: bert_score (unittest.loader._FailedTest)

ImportError: Failed to import test module: bert_score
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/lib/python3.6/unittest/loader.py", line 462, in _find_test_path
package = self._get_module_from_name(name)
File "/home/ec2-user/anaconda3/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name
import(name)
File "/home/ec2-user/useful_code/bert_score/bert_score/init.py", line 2, in
from .utils import *
File "/home/ec2-user/useful_code/bert_score/bert_score/utils.py", line 32, in
+ list(SCIBERT_URL_DICT.keys())
AttributeError: type object 'BertConfig' has no attribute 'pretrained_config_archive_map'

Solution

SInce this attribute is no longer being used anywhere, the easy fix here is to remove the map from utils.py as everything is migrated to AutoTokenizer anyway.

@Tiiiger
Copy link
Owner

Tiiiger commented Jun 5, 2020

Good catch. Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants