Skip to content

Commit 2963a4c

Browse files
committed
inline type annotation of variable "callback"
1 parent 71bf957 commit 2963a4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autointent/_wrappers/embedder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from sentence_transformers.similarity_functions import SimilarityFunction
2424
from sentence_transformers.training_args import BatchSamplers
2525
from sklearn.model_selection import train_test_split
26-
from transformers import EarlyStoppingCallback
26+
from transformers import EarlyStoppingCallback, TrainerCallback
2727

2828
from autointent._hash import Hasher
2929
from autointent.configs import EmbedderConfig, EmbedderFineTuningConfig, TaskTypeEnum
@@ -156,10 +156,10 @@ def train(self, utterances: list[str], labels: list[int], config: EmbedderFineTu
156156
batch_sampler=BatchSamplers.NO_DUPLICATES,
157157
metric_for_best_model="eval_loss",
158158
load_best_model_at_end=True,
159-
evaluation_strategy="epoch",
159+
eval_strategy="epoch",
160160
greater_is_better=False,
161161
)
162-
callback = []
162+
callback: list[TrainerCallback] = []
163163
if config.early_stopping:
164164
callback.append(
165165
EarlyStoppingCallback(

0 commit comments

Comments
 (0)