Skip to content

Commit 400066d

Browse files
authored
Merge pull request #122 from EleutherAI/logprobs
Add AUC and other small tweaks
2 parents 4ae3a55 + dfaf0da commit 400066d

File tree

6 files changed

+230
-277
lines changed

6 files changed

+230
-277
lines changed

.github/workflows/build.yml

-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ jobs:
2424
pip install -e ".[dev,visualize]"
2525
- name: Run tests
2626
run: pytest
27-
- name: Type Checking
28-
uses: jakebailey/pyright-action@v1
29-
with:
30-
version: 1.1.378
3127
- name: build
3228
run: pip wheel --no-deps -w dist .
3329
release:

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)