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

Ner.py pretrained_config_archive_map not found for any model #9

Open
info2000 opened this issue Apr 7, 2021 · 3 comments
Open

Ner.py pretrained_config_archive_map not found for any model #9

info2000 opened this issue Apr 7, 2021 · 3 comments

Comments

@info2000
Copy link

info2000 commented Apr 7, 2021

On the initialitation process
label-studio-ml init smdia-backend-ner --script models/ner.py --force

I'm receiving this error to all the models
AttributeError: type object 'BertConfig' has no attribute 'pretrained_config_archive_map'


Traceback (most recent call last):
  File "/usr/local/bin/label-studio-ml", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/label_studio_ml/server.py", line 119, in main
    create_dir(args)
  File "/usr/local/lib/python3.6/dist-packages/label_studio_ml/server.py", line 73, in create_dir
    model_classes = get_all_classes_inherited_LabelStudioMLBase(script_path)
  File "/usr/local/lib/python3.6/dist-packages/label_studio_ml/utils.py", line 29, in get_all_classes_inherited_LabelStudioMLBase
    module = importlib.import_module(module_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/labelstudio/label-studio-transformers/models/ner.py", line 36, in <module>
    [list(conf.pretrained_config_archive_map.keys()) for conf in (BertConfig,CamembertConfig, RobertaConfig, DistilBertConfig)],
  File "/labelstudio/label-studio-transformers/models/ner.py", line 36, in <listcomp>
    [list(conf.pretrained_config_archive_map.keys()) for conf in (BertConfig,CamembertConfig, RobertaConfig, DistilBertConfig)],
AttributeError: type object 'BertConfig' has no attribute 'pretrained_config_archive_map'

I tried to downgrade transformers to 2.0.0 but them fails the transformers import

could someone check this issue?

@whisere
Copy link

whisere commented Apr 8, 2021

It works after pip install transformers==2.10.0

@somejonus
Copy link

Any news on this?

@skshahidur
Copy link

You can comment out this part https://github.com/heartexlabs/label-studio-transformers/blob/master/models/ner.py#L33-L35 @somejonus

It runs fine as it's not used further down the line.

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

No branches or pull requests

4 participants