Skip to content

SwanLab: Add support for id and resume arguments in SwanLabCallback#43779

Open
surya10602 wants to merge 1 commit intohuggingface:mainfrom
surya10602:feat/swanlab-resume-fix
Open

SwanLab: Add support for id and resume arguments in SwanLabCallback#43779
surya10602 wants to merge 1 commit intohuggingface:mainfrom
surya10602:feat/swanlab-resume-fix

Conversation

@surya10602
Copy link
Copy Markdown

Summary

This PR updates SwanLabCallback to accept **kwargs in its __init__ method and passes them to swanlab.init() during setup.

Previously, the SwanLab integration did not expose important initialization arguments like experiment_id, id, or resume. This made it impossible to properly resume training runs (e.g., when using Trainer.train(resume_from_checkpoint=...)) because SwanLab would create a new experiment instead of continuing the existing one.

By allowing **kwargs to be passed through, users can now maintain experiment continuity across restarts by explicitly passing the run ID.

Changes:

  • Updated SwanLabCallback.__init__ to store **kwargs.
  • Updated SwanLabCallback.setup to merge these user-provided arguments into init_args before calling swanlab.init.

Fixes #43698

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed.

Copy link
Copy Markdown
Contributor

@MekkCyber MekkCyber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @surya10602 ! sorry this pr is superseded by #43719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SwanLab integration uses outdated swanlab.init() signature

2 participants