The new version of transformer==4.28.1 cannot use the .generate() function in text generation. The exception is:
File "...\transformers\generation\utils.py", line 1210, in generate self._validate_model_class() File "...\lib\site-packages\transformers\generation\utils.py", line 1070, in _validate_model_class if not self.can_generate(): File "...\lib\site-packages\torch\nn\modules\module.py", line 1729, in __getattr__ raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'") AttributeError: 'PromptForGeneration' object has no attribute 'can_generate'
The same issue also happens here issues:277
The new version of transformer==4.28.1 cannot use the
.generate()function in text generation. The exception is:File "...\transformers\generation\utils.py", line 1210, in generate self._validate_model_class() File "...\lib\site-packages\transformers\generation\utils.py", line 1070, in _validate_model_class if not self.can_generate(): File "...\lib\site-packages\torch\nn\modules\module.py", line 1729, in __getattr__ raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'") AttributeError: 'PromptForGeneration' object has no attribute 'can_generate'The same issue also happens here issues:277