timoschick / dino

This repository contains the code for "Generating Datasets with Pretrained Language Models".
https://arxiv.org/abs/2104.07540
Apache License 2.0
187 stars 24 forks source link

AttributeError: 'GPT2Wrapper' object has no attribute 'model' #14

Open suparklingmin opened 2 years ago

suparklingmin commented 2 years ago

https://github.com/timoschick/dino/blob/0e4a0525f05dfa763bb99fe7cbde2563be32df4f/modeling.py#L275

Hello, I tried to generate single text and encountered the following error.

  File "/home/myname/dino/modeling.py", line 275, in generate_self_debiasing
    max_length = min(self.model._model.config.max_position_embeddings, max_length + input_length)
AttributeError: 'GPT2Wrapper' object has no attribute 'model'

I replaced self.model._model with self._model, which solved the problem.