From 173ccd8d27d593372a9fe34c2815be1aa580fc53 Mon Sep 17 00:00:00 2001 From: rainatam Date: Mon, 10 Apr 2023 19:40:21 +0800 Subject: [PATCH] Update trainer --- ptuning/trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ptuning/trainer.py b/ptuning/trainer.py index bbaa9db..5a9a27b 100644 --- a/ptuning/trainer.py +++ b/ptuning/trainer.py @@ -2830,7 +2830,7 @@ class Trainer: for k, v in self.model.named_parameters(): if v.requires_grad: 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: self.tokenizer.save_pretrained(output_dir)