mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-14 19:06:26 +08:00
update trainer
This commit is contained in:
@@ -67,7 +67,10 @@ class PeftTrainer(Seq2SeqTrainer):
|
|||||||
torch.save(state_dict, os.path.join(output_dir, WEIGHTS_NAME))
|
torch.save(state_dict, os.path.join(output_dir, WEIGHTS_NAME))
|
||||||
|
|
||||||
if self.finetuning_args.finetuning_type == "full" and self.tokenizer is not None:
|
if self.finetuning_args.finetuning_type == "full" and self.tokenizer is not None:
|
||||||
self.tokenizer.save_pretrained(output_dir)
|
try:
|
||||||
|
self.tokenizer.save_pretrained(output_dir)
|
||||||
|
except:
|
||||||
|
logger.warning("Cannot save tokenizer, copy the files manually.")
|
||||||
|
|
||||||
with open(os.path.join(output_dir, TRAINING_ARGS_NAME), "w", encoding="utf-8") as f:
|
with open(os.path.join(output_dir, TRAINING_ARGS_NAME), "w", encoding="utf-8") as f:
|
||||||
f.write(self.args.to_json_string() + "\n")
|
f.write(self.args.to_json_string() + "\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user