diff --git a/.gitignore b/.gitignore index 95025315..26218bce 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,9 @@ # Python *.pyc __pycache__ -build/ -dist/ +/build/ +/dist/ +*/conda_build/build/ *.egg-info .env .venv/ diff --git a/clearml/model.py b/clearml/model.py index 79a7f53b..f143da82 100644 --- a/clearml/model.py +++ b/clearml/model.py @@ -2400,11 +2400,15 @@ class OutputModel(BaseModel): # make sure the created model is updated: out_model_file_name = target_filename or weights_filename or register_uri - name = ( - Path(out_model_file_name).stem - if out_model_file_name - else (self._task_connect_name or "Output Model") - ) + + # prefer self._task_connect_name if exists + if self._task_connect_name: + name = self._task_connect_name + elif out_model_file_name: + name = Path(out_model_file_name).stem + else: + name = "Output Model" + if not self._base_model: model = self._get_force_base_model(task_model_entry=name) else: