Skip to content

Commit 8d9255e

Browse files
committed
fix mypy
1 parent 6881bc5 commit 8d9255e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

autointent/modules/scoring/_bert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ def tokenize_function(examples: dict[str, Any]) -> dict[str, Any]:
133133
tokenized_dataset = dataset.map(tokenize_function, batched=True, batch_size=self.batch_size)
134134

135135
metric_name = "f1"
136+
136137
def compute_metrics(predictions: EvalPrediction) -> dict[str, float]:
137-
return {metric_name: scoring_f1(predictions.label_ids.tolist(), predictions.predictions.tolist())}
138+
return {metric_name: scoring_f1(predictions.label_ids.tolist(), predictions.predictions.tolist())} # type: ignore[union-attr]
138139

139140
with tempfile.TemporaryDirectory() as tmp_dir:
140141
training_args = TrainingArguments(

0 commit comments

Comments
 (0)