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

feat: setting up sae_lens package and auto-deploy with semantic-release #66

Merged
merged 2 commits into from
Apr 6, 2024

Conversation

chanind
Copy link
Collaborator

@chanind chanind commented Apr 5, 2024

This PR renames the package to sae-lens to ready it for publication on PyPI. All imports are now from sae_lens. The sae_training and sae_analysis packages are now accessed at sae_lens.training and sae_lens.analysis, respectively. The most commonly imported items from the training package are also exported at the top-level, so it's possible to run from sae_lens import SparseAutoencoder, for example.

In addition, this PR sets up the library to auto-deploy on commit to main based on semantic-release. This means that the commit message to main will determine how the version is bumped in a deploy, or whether a deploy happens at all. For example, the following commit messages will bump the version number as follows:

  • chore: updating docs no version bump
  • fix: the main class no longer errors on osx patch version bump (1.2.3 -> 1.2.4)
  • feat: added a new function minor version bump (1.2.3 -> 1.3.0)
  • feat: redid everything BREAKING CHANGE: everything is different major version bump (1.2.3 -> 2.0.0)

I tried to update all the docs and jupyter notebooks to reflect the new import pattern, but it's possible I missed something somewhere.

This PR adds a custom unpickler method so that currently existing pickled SAEs on huggingface can still be loaded with torch.load() in the session loader.

closes #10

@chanind chanind force-pushed the pypi branch 4 times, most recently from a3e06be to 7ea9d55 Compare April 5, 2024 18:18
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 67.21311% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 55.18%. Comparing base (b8fba4f) to head (3ce7f99).

Files Patch % Lines
sae_lens/training/utils.py 38.09% 13 Missing ⚠️
sae_lens/training/toy_model_runner.py 0.00% 4 Missing ⚠️
sae_lens/training/sae_group.py 84.61% 1 Missing and 1 partial ⚠️
sae_lens/training/train_sae_on_toy_model.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
+ Coverage   52.77%   55.18%   +2.41%     
==========================================
  Files          14       15       +1     
  Lines        1260     1272      +12     
  Branches      198      198              
==========================================
+ Hits          665      702      +37     
+ Misses        553      530      -23     
+ Partials       42       40       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jbloomAus
Copy link
Owner

Amazing, thanks so much!

@jbloomAus jbloomAus merged commit 34633e8 into jbloomAus:main Apr 6, 2024
6 checks passed
tom-pollak pushed a commit to tom-pollak/SAELens that referenced this pull request Oct 22, 2024
feat: setting up sae_lens package and auto-deploy with semantic-release
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.

Publish on PyPI
2 participants