Skip to content
New issue

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: 'SelfDebiasingGPT2LMHeadModel' object has no attribute '_init_sequence_length_for_generation' #16

Closed
HarrywillDr opened this issue May 31, 2022 · 1 comment

Comments

@HarrywillDr
Copy link

Done loading 6 inputs from file 'sts-x1-dataset.jsonl'
Starting dataset generation with DINO...
Dataset Entries: 0%| | 0/6 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/Users/lihao/pythonProject/pythonProject/dino.py", line 161, in
outputs = generator.generate_dataset(inputs, num_entries_per_input_and_label=args.num_entries_per_input_and_label,
File "/Users/lihao/pythonProject/pythonProject/modeling.py", line 98, in generate_dataset
dataset += self._generate_dataset_entries(input_text_or_id, label=label, num_entries=num_entries_per_input_and_label,
File "/Users/lihao/pythonProject/pythonProject/modeling.py", line 125, in _generate_dataset_entries
model_outputs = self.model.generate_self_debiasing(
File "/Users/lihao/pythonProject/pythonProject/modeling.py", line 280, in generate_self_debiasing
output_ids = self._model.generate(**inputs, min_length=min_length, max_length=max_length, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/transformers/generation_utils.py", line 1310, in generate
return self.sample(
File "/Users/lihao/pythonProject/pythonProject/generation.py", line 170, in sample
sequence_lengths, unfinished_sequences, cur_len = self._init_sequence_length_for_generation(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1185, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'SelfDebiasingGPT2LMHeadModel' object has no attribute '_init_sequence_length_for_generation'

Hi, when I running the model, I meeting this problem. any idea to solve it? thanks!

@HarrywillDr
Copy link
Author

solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant