示例代码报错

#4
by Renny-Jenius - opened

很抱歉打扰,不知道为什么,在下载好了模型之后,运行示例代码会有报错
runyu.cai@star-SYS-4029GP-TRT:~/ChatTruth-7B$ python3 demo.py
Traceback (most recent call last):
File "/home/runyu.cai/ChatTruth-7B/demo.py", line 7, in
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/tokenization_auto.py", line 774, in from_pretrained
return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 2028, in from_pretrained
return cls._from_pretrained(
File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 2260, in _from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
File "/home/runyu.cai/.cache/huggingface/modules/transformers_modules/ChatTruth-7B/tokenization_qwen.py", line 121, in init
super().init(**kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils.py", line 367, in init
self._add_tokens(
File "/home/runyu.cai/.cache/huggingface/modules/transformers_modules/ChatTruth-7B/tokenization_qwen.py", line 224, in _add_tokens
if surface_form not in SPECIAL_TOKENS + self.IMAGE_ST:
AttributeError: 'QWenTokenizer' object has no attribute 'IMAGE_ST'
这是为什么呢?

对齐版本或者 tokenization_qwen.py 121行放到138行

Sign up or log in to comment