Former-commit-id: 37799a62d4431d1d8c02fee6c23d607a65723c1a
This commit is contained in:
hiyouga 2024-05-12 01:25:16 +08:00
parent 8f1ba07b30
commit 7b02c83399

View File

@ -139,13 +139,15 @@ class LogCallback(TrainerCallback):
r""" r"""
Event called after an evaluation phase. Event called after an evaluation phase.
""" """
self._close_thread_pool() if not self.do_train:
self._close_thread_pool()
def on_predict(self, args: "TrainingArguments", state: "TrainerState", control: "TrainerControl", **kwargs): def on_predict(self, args: "TrainingArguments", state: "TrainerState", control: "TrainerControl", **kwargs):
r""" r"""
Event called after a successful prediction. Event called after a successful prediction.
""" """
self._close_thread_pool() if not self.do_train:
self._close_thread_pool()
def on_log(self, args: "TrainingArguments", state: "TrainerState", control: "TrainerControl", **kwargs): def on_log(self, args: "TrainingArguments", state: "TrainerState", control: "TrainerControl", **kwargs):
r""" r"""