Skip to content

Commit 52242bc

Browse files
authored
Merge pull request #80 from EleutherAI/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 7e20d4a + 8c30a90 commit 52242bc

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.4.0
5+
rev: v5.0.0
66
hooks:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- id: check-added-large-files
1010
- repo: https://github.com/psf/black
11-
rev: 23.3.0
11+
rev: 25.1.0
1212
hooks:
1313
- id: black
14-
- repo: https://github.com/charliermarsh/ruff-pre-commit
15-
rev: 'v0.0.262'
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: 'v0.9.6'
1616
hooks:
1717
- id: ruff
1818
args: [--fix, --exit-non-zero-on-fix]

delphi/log/result_analysis.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ def parse_score_file(file_path):
153153
"total_examples": total_examples,
154154
"total_positives": total_positives,
155155
"total_negatives": total_negatives,
156-
"positive_class_ratio": total_positives / total_examples
157-
if total_examples > 0
158-
else 0,
159-
"negative_class_ratio": total_negatives / total_examples
160-
if total_examples > 0
161-
else 0,
156+
"positive_class_ratio": (
157+
total_positives / total_examples if total_examples > 0 else 0
158+
),
159+
"negative_class_ratio": (
160+
total_negatives / total_examples if total_examples > 0 else 0
161+
),
162162
"failed_count": failed_count,
163163
}
164164

delphi/scorers/simulator/oai_autointerp/explanations/simulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def from_string(cls, s: str) -> SimulationType:
8787

8888

8989
def compute_expected_value(
90-
norm_probabilities_by_distribution_value: OrderedDict[int, float]
90+
norm_probabilities_by_distribution_value: OrderedDict[int, float],
9191
) -> float:
9292
"""
9393
Given a map from distribution values (integers on the range [0, 10]) to normalized

examples/score_explanations.ipynb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,21 @@
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23+
"import os\n",
2324
"from functools import partial\n",
24-
"import os \n",
25-
"import torch\n",
25+
"\n",
2626
"import orjson\n",
27+
"import torch\n",
28+
"\n",
2729
"from delphi.clients import OpenRouter\n",
2830
"from delphi.config import ExperimentConfig, LatentConfig\n",
2931
"from delphi.explainers import explanation_loader\n",
30-
"from delphi.latents import (\n",
31-
" LatentDataset\n",
32-
")\n",
32+
"from delphi.latents import LatentDataset\n",
3333
"from delphi.latents.constructors import default_constructor\n",
3434
"from delphi.latents.samplers import sample\n",
3535
"from delphi.pipeline import Pipeline, process_wrapper\n",
3636
"from delphi.scorers import FuzzingScorer\n",
3737
"\n",
38-
"\n",
39-
"\n",
4038
"API_KEY = os.getenv(\"OPENROUTER_API_KEY\")"
4139
]
4240
},

0 commit comments

Comments
 (0)