Skip to content

Commit 11e10e5

Browse files
committed
clean up result analysis
1 parent 22a6c6e commit 11e10e5

File tree

4 files changed

+219
-260
lines changed

4 files changed

+219
-260
lines changed

delphi/__main__.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ def load_artifacts(run_cfg: RunConfig):
5555
compile=True,
5656
)
5757

58-
return run_cfg.hookpoints, hookpoint_to_sparse_encode, model, transcode
58+
return (
59+
list(hookpoint_to_sparse_encode.keys()),
60+
hookpoint_to_sparse_encode,
61+
model,
62+
transcode,
63+
)
5964

6065

6166
def create_neighbours(
@@ -212,7 +217,7 @@ def scorer_postprocess(result, score_dir):
212217
client,
213218
n_examples_shown=run_cfg.num_examples_per_scorer_prompt,
214219
verbose=run_cfg.verbose,
215-
log_prob=False,
220+
log_prob=run_cfg.log_probs,
216221
),
217222
preprocess=scorer_preprocess,
218223
postprocess=partial(scorer_postprocess, score_dir=detection_scores_path),
@@ -222,7 +227,7 @@ def scorer_postprocess(result, score_dir):
222227
client,
223228
n_examples_shown=run_cfg.num_examples_per_scorer_prompt,
224229
verbose=run_cfg.verbose,
225-
log_prob=False,
230+
log_prob=run_cfg.log_probs,
226231
),
227232
preprocess=scorer_preprocess,
228233
postprocess=partial(scorer_postprocess, score_dir=fuzz_scores_path),

delphi/config.py

+3
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ class RunConfig(Serializable):
142142
filter_bos: bool = False
143143
"""Whether to filter out BOS tokens from the cache."""
144144

145+
log_probs: bool = False
146+
"""Whether to attempt to gather log probabilities for each scorer prompt."""
147+
145148
load_in_8bit: bool = False
146149
"""Load the model in 8-bit mode."""
147150

0 commit comments

Comments
 (0)