问题描述
我正在尝试使用变形金刚库(通过拥抱脸)加载预先训练的模型:
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.
知道为什么会发生吗?
解决方法
这可能意味着您的docker实例无法访问互联网