BART loading from HuggingFace requires logging in

3k views Asked by At

I'm trying to use pretrained model from HuggingFace. However, I get the following error,

OSError: bart-large is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with `use_auth_token` or log in with `huggingface-cli login` and pass `use_auth_token=True`.

The code I'm using is a little dated, and I have not found definite solution, and I'm not sure if it is a bug, or I really need to somehow log in to use this model.

1

There are 1 answers

0
cronoik On BEST ANSWER

The correct model identifier is facebook/bart-large and not bart-large:

from transformers import BartTokenizer, BartModel

tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
model = BartModel.from_pretrained('facebook/bart-large')