sae-lens 6.28.0__tar.gz → 6.28.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sae_lens-6.28.0 → sae_lens-6.28.1}/PKG-INFO +1 -1
- {sae_lens-6.28.0 → sae_lens-6.28.1}/pyproject.toml +1 -1
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/__init__.py +1 -1
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/loading/pretrained_saes_directory.py +18 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/sae.py +13 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/LICENSE +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/README.md +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/analysis/__init__.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/analysis/hooked_sae_transformer.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/analysis/neuronpedia_integration.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/cache_activations_runner.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/config.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/constants.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/evals.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/llm_sae_training_runner.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/load_model.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/loading/__init__.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/loading/pretrained_sae_loaders.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/pretokenize_runner.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/pretrained_saes.yaml +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/registry.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/__init__.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/batchtopk_sae.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/gated_sae.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/jumprelu_sae.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/matching_pursuit_sae.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/matryoshka_batchtopk_sae.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/standard_sae.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/temporal_sae.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/topk_sae.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/saes/transcoder.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/__init__.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/activation_generator.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/correlation.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/evals.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/feature_dictionary.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/firing_probabilities.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/hierarchy.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/initialization.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/plotting.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/synthetic/training.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/tokenization_and_batching.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/training/__init__.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/training/activation_scaler.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/training/activations_store.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/training/mixing_buffer.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/training/optim.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/training/sae_trainer.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/training/types.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/training/upload_saes_to_huggingface.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/tutorial/tsea.py +0 -0
- {sae_lens-6.28.0 → sae_lens-6.28.1}/sae_lens/util.py +0 -0
|
@@ -103,3 +103,21 @@ def get_config_overrides(release: str, sae_id: str) -> dict[str, Any]:
|
|
|
103
103
|
if sae_info.neuronpedia_id is not None and sae_id in sae_info.neuronpedia_id:
|
|
104
104
|
config_overrides["neuronpedia_id"] = sae_info.neuronpedia_id[sae_id]
|
|
105
105
|
return config_overrides
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def get_releases_for_repo_id(repo_id: str) -> list[str]:
|
|
109
|
+
"""
|
|
110
|
+
Find all release names that use the given HuggingFace repo_id.
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
repo_id: The HuggingFace repository ID to search for.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
A list of release names that use this repo_id.
|
|
117
|
+
"""
|
|
118
|
+
saes_directory = get_pretrained_saes_directory()
|
|
119
|
+
return [
|
|
120
|
+
release
|
|
121
|
+
for release, lookup in saes_directory.items()
|
|
122
|
+
if lookup.repo_id == repo_id
|
|
123
|
+
]
|
|
@@ -47,6 +47,7 @@ from sae_lens.loading.pretrained_saes_directory import (
|
|
|
47
47
|
get_config_overrides,
|
|
48
48
|
get_norm_scaling_factor,
|
|
49
49
|
get_pretrained_saes_directory,
|
|
50
|
+
get_releases_for_repo_id,
|
|
50
51
|
get_repo_id_and_folder_name,
|
|
51
52
|
)
|
|
52
53
|
from sae_lens.registry import get_sae_class, get_sae_training_class
|
|
@@ -624,6 +625,18 @@ class SAE(HookedRootModule, Generic[T_SAE_CONFIG], ABC):
|
|
|
624
625
|
raise ValueError(
|
|
625
626
|
f"Release {release} not found in pretrained SAEs directory, and is not a valid huggingface repo."
|
|
626
627
|
)
|
|
628
|
+
# Check if the user passed a repo_id that's in the pretrained SAEs list
|
|
629
|
+
matching_releases = get_releases_for_repo_id(release)
|
|
630
|
+
if matching_releases:
|
|
631
|
+
warnings.warn(
|
|
632
|
+
f"You are loading an SAE using the HuggingFace repo_id '{release}' directly. "
|
|
633
|
+
f"This repo is registered in the official pretrained SAEs list with release name(s): {matching_releases}. "
|
|
634
|
+
f"For better compatibility and to access additional metadata, consider loading with: "
|
|
635
|
+
f"SAE.from_pretrained(release='{matching_releases[0]}', sae_id='<sae_id>'). "
|
|
636
|
+
f"See the full list of pretrained SAEs at: https://decoderesearch.github.io/SAELens/latest/pretrained_saes/",
|
|
637
|
+
UserWarning,
|
|
638
|
+
stacklevel=2,
|
|
639
|
+
)
|
|
627
640
|
elif sae_id not in sae_directory[release].saes_map:
|
|
628
641
|
# Handle special cases like Gemma Scope
|
|
629
642
|
if (
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|