sae-lens 6.5.0__tar.gz → 6.5.2__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.5.0 → sae_lens-6.5.2}/PKG-INFO +2 -2
- {sae_lens-6.5.0 → sae_lens-6.5.2}/pyproject.toml +2 -2
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/__init__.py +1 -1
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/evals.py +12 -1
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/load_model.py +1 -1
- {sae_lens-6.5.0 → sae_lens-6.5.2}/LICENSE +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/README.md +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/analysis/__init__.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/analysis/hooked_sae_transformer.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/analysis/neuronpedia_integration.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/cache_activations_runner.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/config.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/constants.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/llm_sae_training_runner.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/loading/__init__.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/loading/pretrained_sae_loaders.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/loading/pretrained_saes_directory.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/pretokenize_runner.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/pretrained_saes.yaml +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/registry.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/saes/__init__.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/saes/batchtopk_sae.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/saes/gated_sae.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/saes/jumprelu_sae.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/saes/sae.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/saes/standard_sae.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/saes/topk_sae.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/saes/transcoder.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/tokenization_and_batching.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/training/__init__.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/training/activation_scaler.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/training/activations_store.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/training/mixing_buffer.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/training/optim.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/training/sae_trainer.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/training/types.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/training/upload_saes_to_huggingface.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/tutorial/tsea.py +0 -0
- {sae_lens-6.5.0 → sae_lens-6.5.2}/sae_lens/util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sae-lens
|
|
3
|
-
Version: 6.5.
|
|
3
|
+
Version: 6.5.2
|
|
4
4
|
Summary: Training and Analyzing Sparse Autoencoders (SAEs)
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: deep-learning,sparse-autoencoders,mechanistic-interpretability,PyTorch
|
|
@@ -16,7 +16,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
|
16
16
|
Provides-Extra: mamba
|
|
17
17
|
Requires-Dist: automated-interpretability (>=0.0.5,<1.0.0)
|
|
18
18
|
Requires-Dist: babe (>=0.0.7,<0.0.8)
|
|
19
|
-
Requires-Dist: datasets (>=
|
|
19
|
+
Requires-Dist: datasets (>=3.1.0,<4.0.0)
|
|
20
20
|
Requires-Dist: mamba-lens (>=0.0.4,<0.0.5) ; extra == "mamba"
|
|
21
21
|
Requires-Dist: matplotlib (>=3.8.3,<4.0.0)
|
|
22
22
|
Requires-Dist: matplotlib-inline (>=0.1.6,<0.2.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "sae-lens"
|
|
3
|
-
version = "6.5.
|
|
3
|
+
version = "6.5.2"
|
|
4
4
|
description = "Training and Analyzing Sparse Autoencoders (SAEs)"
|
|
5
5
|
authors = ["Joseph Bloom"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -25,7 +25,7 @@ plotly = "^5.19.0"
|
|
|
25
25
|
plotly-express = "^0.4.1"
|
|
26
26
|
matplotlib = "^3.8.3"
|
|
27
27
|
matplotlib-inline = "^0.1.6"
|
|
28
|
-
datasets = "^
|
|
28
|
+
datasets = "^3.1.0"
|
|
29
29
|
babe = "^0.0.7"
|
|
30
30
|
nltk = "^3.8.1"
|
|
31
31
|
safetensors = "^0.4.2"
|
|
@@ -776,6 +776,7 @@ def multiple_evals(
|
|
|
776
776
|
n_eval_sparsity_variance_batches: int,
|
|
777
777
|
eval_batch_size_prompts: int = 8,
|
|
778
778
|
datasets: list[str] = ["Skylion007/openwebtext", "lighteval/MATH"],
|
|
779
|
+
dataset_trust_remote_code: bool = False,
|
|
779
780
|
ctx_lens: list[int] = [128],
|
|
780
781
|
output_dir: str = "eval_results",
|
|
781
782
|
verbose: bool = False,
|
|
@@ -822,7 +823,11 @@ def multiple_evals(
|
|
|
822
823
|
for ctx_len in ctx_lens:
|
|
823
824
|
for dataset in datasets:
|
|
824
825
|
activation_store = ActivationsStore.from_sae(
|
|
825
|
-
current_model,
|
|
826
|
+
current_model,
|
|
827
|
+
sae,
|
|
828
|
+
context_size=ctx_len,
|
|
829
|
+
dataset=dataset,
|
|
830
|
+
dataset_trust_remote_code=dataset_trust_remote_code,
|
|
826
831
|
)
|
|
827
832
|
activation_store.shuffle_input_dataset(seed=42)
|
|
828
833
|
|
|
@@ -882,6 +887,7 @@ def run_evaluations(args: argparse.Namespace) -> list[dict[str, Any]]:
|
|
|
882
887
|
n_eval_sparsity_variance_batches=args.n_eval_sparsity_variance_batches,
|
|
883
888
|
eval_batch_size_prompts=args.batch_size_prompts,
|
|
884
889
|
datasets=args.datasets,
|
|
890
|
+
dataset_trust_remote_code=args.dataset_trust_remote_code,
|
|
885
891
|
ctx_lens=args.ctx_lens,
|
|
886
892
|
output_dir=args.output_dir,
|
|
887
893
|
verbose=args.verbose,
|
|
@@ -1004,6 +1010,11 @@ def process_args(args: list[str]) -> argparse.Namespace:
|
|
|
1004
1010
|
default=["Skylion007/openwebtext"],
|
|
1005
1011
|
help="Datasets to evaluate on, such as 'Skylion007/openwebtext' or 'lighteval/MATH'.",
|
|
1006
1012
|
)
|
|
1013
|
+
arg_parser.add_argument(
|
|
1014
|
+
"--dataset_trust_remote_code",
|
|
1015
|
+
action="store_true",
|
|
1016
|
+
help="Allow execution of remote code when loading datasets for evaluation.",
|
|
1017
|
+
)
|
|
1007
1018
|
arg_parser.add_argument(
|
|
1008
1019
|
"--ctx_lens",
|
|
1009
1020
|
nargs="+",
|
|
@@ -52,7 +52,7 @@ def load_model(
|
|
|
52
52
|
if model_class_name == "AutoModelForCausalLM":
|
|
53
53
|
hf_model = AutoModelForCausalLM.from_pretrained(
|
|
54
54
|
model_name, **model_from_pretrained_kwargs
|
|
55
|
-
).to(device)
|
|
55
|
+
).to(device) # type: ignore
|
|
56
56
|
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
57
57
|
return HookedProxyLM(hf_model, tokenizer)
|
|
58
58
|
|
|
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
|