Fix SwanLab callback to forward resume init args#43848
Merged
MekkCyber merged 1 commit intohuggingface:mainfrom Feb 10, 2026
Merged
Fix SwanLab callback to forward resume init args#43848MekkCyber merged 1 commit intohuggingface:mainfrom
MekkCyber merged 1 commit intohuggingface:mainfrom
Conversation
Contributor
Author
|
Thanks both for the guidance. I have now trimmed this PR to tests only so it does not modify What remains in this PR:
I also aligned the test setup with current Local verification: If you want, I can further narrow the test scope. |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
jiosephlee
pushed a commit
to jiosephlee/transformers_latest
that referenced
this pull request
Feb 11, 2026
test: keep SwanLab env forwarding coverage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #43698 by adding SwanLab resume init argument support in the Trainer integration.
What changed
SwanLabCallback.setup()now forwards two optional env-based init args toswanlab.init(...):SWANLAB_RUN_ID->idSWANLAB_RESUME->resumeid/resumeforwarded)id/resumeforwarded)Why env vars?
This keeps the integration change minimal and backward-compatible while providing a direct way to pass SwanLab's resume parameters in resumed training workflows.
Tests
PYTHONPATH=src uv run --with pytest pytest -q tests/trainer/test_trainer_callback.py -k SwanLabCallbackTestuvx ruff check tests/trainer/test_trainer_callback.py