Skip to content

Conversation

@kapedalex
Copy link
Contributor

@kapedalex kapedalex commented Jan 8, 2026

Description

Moved wandb import and initialization inside the train function to make it an optional dependency. Added is_library_available check to prevent crashes if wandb is not installed and for future reference.

Fixes #1130 and #1102

Type of change

  • Bug fix

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not rewritten tests relating to key interfaces which would affect backward compatibility

@kapedalex
Copy link
Contributor Author

As I can see there are only 'No space left on device' errors, so tests passed.
To fix them we could use this: https://github.com/jlumbroso/free-disk-space, but I worry it might break home runner. I will leave link here as potential solution for later.

@kapedalex kapedalex changed the title Fix 1130 Fix 1130 and 1102 Jan 9, 2026
@jlarson4 jlarson4 merged commit edef345 into TransformerLensOrg:dev Jan 20, 2026
36 of 39 checks passed
jlarson4 added a commit that referenced this pull request Feb 3, 2026
Cherry-picked from v2.17.0 commit edef345
Adapted for dev-3.x utilities structure

- Moved wandb import inside if config.wandb block
- Added is_library_available check before importing wandb
- Created utilities/library_utils.py with is_library_available function
- Exported is_library_available from utilities/__init__.py and utils.py
- Updated train.py to use library_utils.is_library_available
- Added test for is_library_available
- Removed poetry.lock (dev-3.x uses uv)

Original commit: edef345 Fix 1130 and 1102 (#1154)
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.

3 participants