Skip to content

Commit

Permalink
fix #3658
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed May 11, 2024
1 parent 58c522c commit 4777efe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/llmtuner/extras/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ def on_evaluate(self, args: "TrainingArguments", state: "TrainerState", control:
r"""
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):
r"""
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):
r"""
Expand Down

0 comments on commit 4777efe

Please sign in to comment.