Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Rm redundant tuning configuration wrapper in checkpoint saving #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mmgpt/train/instruction_finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def apply_decay(x):
"model_state_dict": get_checkpoint(ddp_model),
"optimizer_state_dict": optimizer.state_dict(),
"lr_scheduler_state_dict": lr_scheduler.state_dict(),
"tuning_config": tuning_config,
"tuning_config": tuning_config.tuning_config,
}

print(f"Saving checkpoint to {args.run_name}/checkpoint_{epoch}.pt")
Expand All @@ -324,7 +324,7 @@ def apply_decay(x):
os.remove(f"{args.run_name}/checkpoint_{epoch-1}.pt")
if args.rank == 0:
torch.save(
{"model_state_dict": get_checkpoint(ddp_model.module), "tuning_config": tuning_config},
{"model_state_dict": get_checkpoint(ddp_model.module), "tuning_config": tuning_config.tuning_config},
f"{args.run_name}/final_weights.pt",
)
if args.report_to_wandb and args.save_checkpoints_to_wandb:
Expand Down