We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
会报错:AttributeError: ‘ChatGLMTokenizer‘ object has no attribute ‘sp_tokenizer 请问如何解决
The text was updated successfully, but these errors were encountered:
把tokenization_chatglm.py中
self.sp_tokenizer = SPTokenizer(vocab_file, num_image_tokens=num_image_tokens)
这一行代码移动到super().__init__函数前面,如下:
super().__init__
class ChatGLMTokenizer(PreTrainedTokenizer): """ Construct a ChatGLM tokenizer. Based on byte-level Byte-Pair-Encoding. Args: vocab_file (`str`): Path to the vocabulary file. """ vocab_files_names = {"vocab_file": "ice_text.model"} max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES model_input_names = ["input_ids", "attention_mask", "position_ids"] def __init__( self, vocab_file, do_lower_case=False, remove_space=False, bos_token='<sop>', eos_token='<eop>', end_token='</s>', mask_token='[MASK]', gmask_token='[gMASK]', padding_side="left", pad_token="<pad>", unk_token="<unk>", num_image_tokens=20000, **kwargs ) -> None: self.sp_tokenizer = SPTokenizer(vocab_file, num_image_tokens=num_image_tokens) super().__init__( do_lower_case=do_lower_case, remove_space=remove_space, padding_side=padding_side, bos_token=bos_token, eos_token=eos_token, end_token=end_token, mask_token=mask_token, gmask_token=gmask_token, pad_token=pad_token, unk_token=unk_token, num_image_tokens=num_image_tokens, **kwargs ) """ Initialisation """
Sorry, something went wrong.
No branches or pull requests
会报错:AttributeError: ‘ChatGLMTokenizer‘ object has no attribute ‘sp_tokenizer
请问如何解决
The text was updated successfully, but these errors were encountered: