dwadden / dygiepp

Span-based system for named entity, relation, and event extraction.
MIT License
569 stars 120 forks source link

Alternative Huggingface BERT models not recognized #111

Closed serenalotreck closed 1 year ago

serenalotreck commented 1 year ago

Hi again!

I'm trying to train some models from scratch using different BERT embeddings. I've taken all of the model identifiers from https://huggingface.co/models, but when I run bash scripts/train.sh my_config, I get the following error:

OSError: Can't load config for 'alvaroalon2/biobert_chemical_ner'. Make sure that:

- 'alvaroalon2/biobert_chemical_ner' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'alvaroalon2/biobert_chemical_ner' is the correct path to a directory containing a config.json file

This happens for all the models that I chose, including models from different users.

Have you run into this/do you have any idea what the issue might be? I took a look at the documentation for allennlp train, but I didn't see anything immediately informative.

EDIT: I also tried instantiating a tokenizer using these models with the huggingface API, and that works fine.

Thanks! Serena

serenalotreck commented 1 year ago

Closing this because I believe this was due to torch not being compiled with CUDA capabilities; I ran into this same error when using Huggingface directly and it was solved once I ran

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia