Skip to content

Commit 71a54c7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 402b297 commit 71a54c7

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

elk/extraction/extraction.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Functions for extracting the hidden states of a model."""
2+
23
import os
34
from collections import defaultdict
45
from dataclasses import InitVar, dataclass, replace

elk/plotting/visualize.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def render(
7878
y=dataset_data["auroc_estimate"],
7979
mode="lines",
8080
name=ensemble,
81-
showlegend=False
82-
if dataset_name != unique_datasets[0]
83-
else True,
81+
showlegend=(
82+
False if dataset_name != unique_datasets[0] else True
83+
),
8484
line=dict(color=color_map[ensemble]),
8585
),
8686
row=row,

elk/promptsource/templates.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ def _escape_pipe(cls, example):
215215
# Replaces any occurrences of the "|||" separator in the example, which
216216
# which will be replaced back after splitting
217217
protected_example = {
218-
key: value.replace("|||", cls.pipe_protector)
219-
if isinstance(value, str)
220-
else value
218+
key: (
219+
value.replace("|||", cls.pipe_protector)
220+
if isinstance(value, str)
221+
else value
222+
)
221223
for key, value in example.items()
222224
}
223225
return protected_example

elk/training/platt_scaling.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class PlattMixin(ABC):
1212
scale: nn.Parameter
1313

1414
@abstractmethod
15-
def __call__(self, *args: Any, **kwds: Any) -> Any:
16-
...
15+
def __call__(self, *args: Any, **kwds: Any) -> Any: ...
1716

1817
def platt_scale(self, labels: Tensor, hiddens: Tensor, max_iter: int = 100):
1918
"""Fit the scale and bias terms to data with LBFGS.

0 commit comments

Comments
 (0)