Skip to content

Commit

Permalink
fix(runner): remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
Hzfinfdu committed Jul 26, 2024
1 parent 3d0fd81 commit 5b83b41
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/lm_saes/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,6 @@ def language_model_sae_runner(cfg: LanguageModelSAETrainingConfig):
cfg.sae.save_hyperparameters(os.path.join(cfg.exp_result_dir, cfg.exp_name))
cfg.lm.save_lm_config(os.path.join(cfg.exp_result_dir, cfg.exp_name))

if (
cfg.sae.norm_activation == "dataset-wise" and cfg.sae.dataset_average_activation_norm is None
or cfg.sae.init_decoder_norm is None
):
assert not cfg.finetuning
sae = SparseAutoEncoder.from_initialization_searching(
activation_store=activation_store,
cfg=cfg,
)
else:
sae = SparseAutoEncoder.from_config(cfg=cfg.sae)

if cfg.finetuning:
# Fine-tune SAE with frozen encoder weights and bias
sae.train_finetune_for_suppression_parameters()

cfg.sae.save_hyperparameters(os.path.join(cfg.exp_result_dir, cfg.exp_name))
cfg.lm.save_lm_config(os.path.join(cfg.exp_result_dir, cfg.exp_name))

if cfg.wandb.log_to_wandb and is_master():
wandb_config: dict = {
**asdict(cfg),
Expand Down

0 comments on commit 5b83b41

Please sign in to comment.