我正在尝试使用transformers lib加载一个预先训练好的模型(通过拥抱脸):
from transformers import GPT2Tokenizer, GPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
使用本地机器,它开始下载模型。但使用docker时,我得到的结果如下:
OSError: Model name 'gpt2-medium' was not found in tokenizers model
name list (gpt2, gpt2-medium, gpt2-large, gpt2-xl, distilgpt2). We
assumed 'gpt2-medium' was a path, a model identifier, or url to a
directory containing vocabulary files named ['vocab.json',
'merges.txt'] but couldn't find such vocabulary files at this path or url.
你知道为什么会这样吗?
发布于 2020-10-14 22:40:15
这可能意味着您的docker实例无法访问互联网
https://stackoverflow.com/questions/63902455
复制相似问题