Browse Source

Update trainer

pull/518/head
rainatam 2 years ago
parent
commit
173ccd8d27
  1. 2
      ptuning/trainer.py

2
ptuning/trainer.py

@ -2830,7 +2830,7 @@ class Trainer:
for k, v in self.model.named_parameters(): for k, v in self.model.named_parameters():
if v.requires_grad: if v.requires_grad:
filtered_state_dict[k] = state_dict[k] filtered_state_dict[k] = state_dict[k]
self.model.save_pretrained(output_dir, state_dict=state_dict) self.model.save_pretrained(output_dir, state_dict=filtered_state_dict)
if self.tokenizer is not None: if self.tokenizer is not None:
self.tokenizer.save_pretrained(output_dir) self.tokenizer.save_pretrained(output_dir)

Loading…
Cancel
Save