Skip to content

Error in /tutorial/basic.py #82

@KyrieCui

Description

@KyrieCui

When I run the code in /tutorial/basic.py:
tokenized_example = wrapped_t5tokenizer.tokenize_one_example(wrapped_example, teacher_forcing=False)
There is an AttributeError:

/usr/local/lib/python3.7/dist-packages/openprompt/plms/seq2seq.py in tokenize_one_example(self, wrapped_example, teacher_forcing)
89 encode_text = [0] # can be replace by any token, since these token will use their own embeddings
90 else:
---> 91 encode_text = self.tokenizer.encode(piece['text'], add_special_tokens=False)
92
93 encoding_length = len(encode_text)

AttributeError: 'NoneType' object has no attribute 'encode'

Could you tell me how to fix this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions