You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "mypath/trylongformerzh1.py", line 3, in <module>
tokenizer = LongformerTokenizer.from_pretrained("pretrain_path/longformer_zh")
File "virtualenv_path/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1744, in from_pretrained
return cls._from_pretrained(
File "virtualenv_path/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1872, in _from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
File "virtualenv_path/lib/python3.8/site-packages/transformers/models/roberta/tokenization_roberta.py", line 159, in __init__
super().__init__(
File "virtualenv_path/lib/python3.8/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
I'm not sure if it's able to directly ask you questions in Chinese. If it caused misinterpretations, I can change to English.
您好!我现在正在使用您的预训练模型,文件下载自 https://huggingface.co/ValkyriaLenneth/longformer_zh 。我直接使用AutoTokenizer的话,代码会自动调用LongformerTokenizer,然后会报如下错误:
我看到您的代码中使用的是BertTokenizerFast,所以请问加载longformer_zh的tokenizer是否也需要使用BertTokenizer?
我直接用BertTokenizer确实是可以运行的。
另:我是使用
transformers.LongformerModel.from_pretrained
来加载您的模型。我暂时没有测试其他功能,直接加载模型似乎是可行的。我的transformers版本是4.12.5,我能够运行成功的代码是:
如果您有时间浏览本issue的话,我会非常感谢!
The text was updated successfully, but these errors were encountered: