我正在尝试使用来自HuggingFace的预培训模型。但是,我得到以下错误,
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`.我使用的代码有点过时,我还没有找到明确的解决方案,我也不确定它是否是一个bug,或者我真的需要以某种方式登录才能使用这个模型。
发布于 2022-07-26 07:47:10
正确的模型标识符是facebook/bart-大型而不是bart-large。
from transformers import BartTokenizer, BartModel
tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
model = BartModel.from_pretrained('facebook/bart-large')https://stackoverflow.com/questions/73117866
复制相似问题