Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 16, 2023
1 parent f38b91c commit cef2b61
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 6 additions & 5 deletions elk/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ def sweep(args):
# evaluate(args) # args: models_path hidden_states_paths

# for path_model in paths:
# pass model to eval
# models_path = ...
# hidden_states_paths = paths
# evaluate(args) # args: models_path hidden_states_paths
# pass model to eval
# models_path = ...
# hidden_states_paths = paths
# evaluate(args) # args: models_path hidden_states_paths


def run():
parser = ArgumentParser(add_help=False)
Expand Down Expand Up @@ -136,7 +137,7 @@ def run():
# Prevent printing from processes other than the first one
with redirect_stdout(None) if local_rank != 0 else nullcontext():
for key in list(vars(args).keys()):
print("{}: {}".format(key, vars(args)[key]))
print("{}: {}".format(key, vars(args)[key]))

if local_rank != 0:
logging.getLogger("transformers").setLevel(logging.ERROR)
Expand Down
2 changes: 1 addition & 1 deletion elk/evaluate/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def evaluate(args):

ccs_models = torch.load(args.ccs_models_path)
L = hiddens.shape[1]

statistics = []
for ccs_model in ccs_models:
ccs_model.eval()
Expand Down
2 changes: 2 additions & 0 deletions elk/evaluate/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
from pathlib import Path
from ..files import elk_cache_dir


def get_evaluate_parser():
parser = ArgumentParser(add_help=False)
add_eval_args(parser)
return parser


def add_eval_args(parser):
parser.add_argument(
"ccs_models_path",
Expand Down

0 comments on commit cef2b61

Please sign in to comment.