Closed JoPfeiff closed 3 years ago
hot fix which does not log the warning that the parameters were not instantiated
can we keep the logging and reduce the log level from "warn" to "info"?
Can we just remove the weights from the checkpoints?
import sys
from shutil import copyfile
import torch
chckpt_path = sys.argv[1]
copyfile(chckpt_path, chckpt_path + '.backup')
chckpt = torch.load(chckpt_path, map_location=torch.device('cpu'))
chckpt_new = dict()
for k, w in chckpt.items():
if 'adapter_attention' not in k:
chckpt_new[k] = w
else:
print('unwanted key: {}'.format(k))
torch.save(chckpt_new, chckpt_path)
š Bug
Old versions of the adapters initialized
*adapter_attention*
which were never used but stored. I proposed a two stage fix:[ ] hot fix which does not log the warning that the parameters were not instantiated
[ ] remove the parameters from all adapters
Information
Model I am using (Bert, XLNet ...): e.g. RoBERTa-Base
Language I am using the model on (English, Chinese ...): English
Adapter setup I am using (if any): many but e.g.
The problem arises when using:
The tasks I am working on is:
To reproduce
Steps to reproduce the behavior:
Expected behavior
no warning
Environment info
transformers
version: