mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 18:22:34 +06:00
Mlflowcallback fix nonetype error (#17171)
* Fix edge cases TypeError: 'NoneType' object is not callable * fix style
This commit is contained in:
parent
95b6bef624
commit
2f611f85e2
@ -880,7 +880,11 @@ class MLflowCallback(TrainerCallback):
|
||||
def __del__(self):
|
||||
# if the previous run is not terminated correctly, the fluent API will
|
||||
# not let you start a new run before the previous one is killed
|
||||
if self._auto_end_run and self._ml_flow and self._ml_flow.active_run() is not None:
|
||||
if (
|
||||
self._auto_end_run
|
||||
and callable(getattr(self._ml_flow, "active_run", None))
|
||||
and self._ml_flow.active_run() is not None
|
||||
):
|
||||
self._ml_flow.end_run()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user