Skip to content

Commit

Permalink
fix(ft4supp): supp final ver.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hzfinfdu committed Aug 4, 2024
1 parent 3efe943 commit f80cb0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lm_saes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def __post_init__(self):
self.lr_cool_down_steps = int(self.lr_cool_down_steps * total_training_steps)
print_once(f"Learning rate cool down steps: {self.lr_cool_down_steps}")
if self.finetuning:
assert self.l1_coefficient == 0.0, "L1 coefficient must be 0.0 for finetuning."
assert self.sae.l1_coefficient == 0.0, "L1 coefficient must be 0.0 for finetuning."

@dataclass(kw_only=True)
class LanguageModelSAEPruningConfig(LanguageModelSAERunnerConfig):
Expand Down
2 changes: 2 additions & 0 deletions src/lm_saes/utils/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import shutil
from huggingface_hub import create_repo, upload_folder, snapshot_download
from lm_saes.utils.misc import print_once


def upload_pretrained_sae_to_hf(sae_path: str, repo_id: str, private: bool = False):
Expand Down Expand Up @@ -54,6 +55,7 @@ def parse_pretrained_name_or_path(pretrained_name_or_path: str):
if os.path.exists(pretrained_name_or_path):
return pretrained_name_or_path
else:
print_once(f'Local path `{pretrained_name_or_path}` not found. Downloading from huggingface model hub.')
repo_id = "/".join(pretrained_name_or_path.split("/")[:2])
hook_point = "/".join(pretrained_name_or_path.split("/")[2:])
return download_pretrained_sae_from_hf(repo_id, hook_point)

0 comments on commit f80cb0e

Please sign in to comment.