yhcc / BARTNER

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vocab_file找不到

pythonla opened this issue · comments

File "C:\Users\1\miniconda3\lib\site-packages\transformers\models\gpt2\tokenization_gpt2.py", line 179, in init
with open(vocab_file, encoding="utf-8") as vocab_handle:
TypeError: expected str, bytes or os.PathLike object, not NoneType
您好,我使用3.4.0的transformers加载tokenizer的时候一直报错,然后看了一下transformers的源码,BartTokenizer要加载json格式的词表,但我从huggingface下载的bart 预训练模型中词表是TXT文件,是transformers版本问题吗? 谢谢

commented

我不太清楚是啥问题,不过为啥不直接BartTokenizer.from_pretrained让它自己下载vocab文件咧。