Skip to content

A programming framework for agentic AI

fix delete (#950)

Susan Xueqing Liua3e770eac53d
diff --git a/flaml/automl/model.py b/flaml/automl/model.py
index 019aee347..96ada5e15 100644
--- a/flaml/automl/model.py
+++ b/flaml/automl/model.py
@@ -732,10 +732,8 @@ class TransformersEstimator(BaseEstimator):
def _delete_one_ckpt(self, ckpt_location):
if self._use_ray is False:
- try:
+ if os.path.exists(ckpt_location):
shutil.rmtree(ckpt_location)
- except FileNotFoundError:
- logger.warning("checkpoint {} not found".format(ckpt_location))
def cleanup(self):
super().cleanup()