Former-commit-id: 4777efe517c05a599f0ccdf9ccf760f3986d126e
This commit is contained in:
hiyouga 2024-05-12 01:25:16 +08:00
parent 51e0f095a9
commit 5f61ae6a5d

View File

@ -139,12 +139,14 @@ class LogCallback(TrainerCallback):
r""" r"""
Event called after an evaluation phase. Event called after an evaluation phase.
""" """
if not self.do_train:
self._close_thread_pool() 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.
""" """
if not self.do_train:
self._close_thread_pool() 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):