cardiffnlp / tweetnlp

TweetNLP for all the NLP enthusiasts working on Twitter! The Python library tweetnlp provides a collection of useful tools to analyze/understand tweets such as sentiment analysis, emoji prediction, and named entity recognition, powered by state-of-the-art language models specialised on Twitter.
https://tweetnlp.org/
MIT License
309 stars 27 forks source link

OSError in loading model #17

Open ebergam opened 1 year ago

ebergam commented 1 year ago

Hi, thanks for the great library!

I have been trying to install tweetnlp on a python3.8 virtual environment, running on Ubuntu 20.04 64bit / Linux 5.4.0-139-generic.

Here's the error:

Traceback (most recent call last):
  File "tryloading.py", line 3, in <module>
    model = tweetnlp.load_model('sentiment')
  File "/home/ebergam/mlenv/lib/python3.8/site-packages/tweetnlp/loader.py", line 45, in load_model
    model_class = model_loader(model_name=model_name, max_length=max_length, *args, **kwargs)
  File "/home/ebergam/mlenv/lib/python3.8/site-packages/tweetnlp/text_classification/model.py", line 163, in __init__
    super().__init__(model_name, max_length=max_length, use_auth_token=use_auth_token)
  File "/home/ebergam/mlenv/lib/python3.8/site-packages/tweetnlp/text_classification/model.py", line 70, in __init__
    self.config, self.tokenizer, self.model = load_model(
  File "/home/ebergam/mlenv/lib/python3.8/site-packages/tweetnlp/util.py", line 81, in load_model
    config = AutoConfig.from_pretrained(model, **config_argument)
  File "/home/ebergam/mlenv/lib/python3.8/site-packages/transformers/models/auto/configuration_auto.py", line 725, in from_pretrained
    config_dict, _ = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/ebergam/mlenv/lib/python3.8/site-packages/transformers/configuration_utils.py", line 561, in get_config_dict
    config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/ebergam/mlenv/lib/python3.8/site-packages/transformers/configuration_utils.py", line 648, in _get_config_dict
    raise EnvironmentError(
OSError: cardiffnlp/twitter-roberta-base-sentiment-latest does not appear to have a file named config.json.

Trying to install without virtualenvironment results in the same error. Could be due to compatibility issues with huggingface-hub?

jpripamonti commented 1 year ago

Hi, do you have openssl-devel, gcc and a rust compiler installed?

ebergam commented 1 year ago

Hi @jpripamonti , yes I do!

ebergam commented 1 year ago

Any suggestions on how to solve?

jpripamonti commented 10 months ago

Are you still experiencing this issue?