Skip to content

[BUG]: The indent of save_model in ppo.py will cause save_model errorΒ #3446

@baibaiw5

Description

@baibaiw5

πŸ› Describe the bug

error indent:
image
correct indent:
image

error when save model
β”‚ /home/bmb/projects/ColossalAI/applications/Chat/examples/train_prompts.py:168 in main β”‚
β”‚ β”‚
β”‚ 165 β”‚ β”‚ β”‚ β”‚ update_timesteps=args.update_timesteps) β”‚
β”‚ 166 β”‚ β”‚
β”‚ 167 β”‚ # save model checkpoint after fitting β”‚
β”‚ ❱ 168 β”‚ trainer.save_model(args.save_path, only_rank0=True, tokenizer=tokenizer) β”‚
β”‚ 169 β”‚ # save optimizer checkpoint on all ranks β”‚
β”‚ 170 β”‚ if args.need_optim_ckpt: β”‚
β”‚ 171 β”‚ β”‚ strategy.save_optimizer(actor_optim, β”‚
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'PPOTrainer' object has no attribute 'save_model'

Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions