fix inference

Former-commit-id: 55dc2bdd3eaa552c655e584fc3cbbf017c7bc3e7
This commit is contained in:
hiyouga
2023-08-01 00:06:48 +08:00
parent 6f65f8cb3b
commit 772ad4ec6b
2 changed files with 3 additions and 2 deletions

View File

@@ -68,7 +68,7 @@ class PeftTrainer(Seq2SeqTrainer):
else:
torch.save(state_dict, os.path.join(output_dir, WEIGHTS_NAME))
if self.tokenizer is not None:
if self.finetuning_args.finetuning_type == "full" and self.tokenizer is not None:
self.tokenizer.save_pretrained(output_dir)
with open(os.path.join(output_dir, TRAINING_ARGS_NAME), "w", encoding="utf-8") as f: