Unverified Commit 1d5ea34f authored by Jonathan Chang's avatar Jonathan Chang Committed by GitHub
Browse files

Fix trainer callback (#7720)

Fix a bug that happends when subclassing Trainer and
overwriting evaluate() without calling prediciton_loop()
parent f176e707
...@@ -443,7 +443,8 @@ class ProgressCallback(TrainerCallback): ...@@ -443,7 +443,8 @@ class ProgressCallback(TrainerCallback):
def on_evaluate(self, args, state, control, **kwargs): def on_evaluate(self, args, state, control, **kwargs):
if state.is_local_process_zero: if state.is_local_process_zero:
self.prediction_bar.close() if self.prediction_bar is not None:
self.prediction_bar.close()
self.prediction_bar = None self.prediction_bar = None
def on_log(self, args, state, control, logs=None, **kwargs): def on_log(self, args, state, control, logs=None, **kwargs):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment