-
Notifications
You must be signed in to change notification settings - Fork 339
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: 'BartConfig' object has no attribute '_to_dict_new' #351
Comments
when I downgrade to version 2.3.0 , it works . |
Hey @LRY1994, this behavior is indeed introduced by a change in v3.x of the library. The recommended way of saving & loading model checkpoints using (adapter-)transformers is via the model.save_pretrained(self.args.best_model_dir)
...
model = BartForConditionalGeneration.from_pretrained(self.args.best_model_dir) We'll look into solving the issues using |
This issue should be fixed with #406 and the next adapter-transformers release (v3.1.0). |
Environment info
adapter-transformers
version:3.0.0Information
Model I am using : BartForConditionalGeneration
Language I am using the model on: English
Adapter setup I am using (if any): no
The problem arises when using:
File "/home/simon/桌面/closed-book-prompt-qa/src/test.py", line 3, in
model = torch.load( "src/temp/model_1653153641/model.bin")
File "/home/simon/anaconda3/envs/qa/lib/python3.8/site-packages/torch/serialization.py", line 712, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/home/simon/anaconda3/envs/qa/lib/python3.8/site-packages/torch/serialization.py", line 1046, in _load
result = unpickler.load()
File "/home/simon/anaconda3/envs/qa/lib/python3.8/site-packages/transformers/configuration_utils.py", line 253, in getattribute
return super().getattribute(key)
AttributeError: 'BartConfig' object has no attribute '_to_dict_new'
Expected behavior
successfully loaded for my downstream task
The text was updated successfully, but these errors were encountered: