diff --git a/assets/training/model_management/components/import_model/spec.yaml b/assets/training/model_management/components/import_model/spec.yaml index 9eb2969307..a875ee0451 100644 --- a/assets/training/model_management/components/import_model/spec.yaml +++ b/assets/training/model_management/components/import_model/spec.yaml @@ -282,7 +282,7 @@ jobs: inputs: model_family: 'MmDetectionImage' model_name: ${{parent.inputs.model_id}} - download_from_source: False + download_from_source: true outputs: output_dir: type: uri_file diff --git a/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/convertors.py b/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/convertors.py index e20fc66285..557e954708 100644 --- a/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/convertors.py +++ b/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/convertors.py @@ -191,11 +191,11 @@ def save_as_mlflow(self): mlflow_model_wrapper = ImagesDetectionMLflowModelWrapper(task_type=self._task) artifacts_dict = self._prepare_artifacts_dict() if self._task == MMLabDetectionTasks.MM_OBJECT_DETECTION.value: - pip_requirements = os.path.join(self.MODEL_DIR, "mmdet-od-requirements.txt") + conda_env_file = os.path.join(self.MODEL_DIR, "conda_od.yaml") elif self._task == MMLabDetectionTasks.MM_INSTANCE_SEGMENTATION.value: - pip_requirements = os.path.join(self.MODEL_DIR, "mmdet-is-requirements.txt") + conda_env_file = os.path.join(self.MODEL_DIR, "conda_is.yaml") else: - pip_requirements = None + conda_env_file = None code_path = [ os.path.join(self.MODEL_DIR, "detection_predict.py"), os.path.join(self.MODEL_DIR, "config.py"), @@ -204,8 +204,8 @@ def save_as_mlflow(self): super()._save( mlflow_model_wrapper=mlflow_model_wrapper, artifacts_dict=artifacts_dict, - pip_requirements=pip_requirements, code_path=code_path, + conda_env=conda_env_file, ) def _prepare_artifacts_dict(self) -> Dict: diff --git a/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/vision/conda_is.yaml b/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/vision/conda_is.yaml new file mode 100644 index 0000000000..96a48f8c67 --- /dev/null +++ b/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/vision/conda_is.yaml @@ -0,0 +1,19 @@ +channels: +- conda-forge +dependencies: +- python=3.9.19 +- pip<=24.0 +- pip: + - mlflow==2.12.1 + - cloudpickle==2.2.1 + - datasets==2.15.0 + - openmim==0.3.9 + - torch==2.0.1 + - torchvision==0.15.2 + - transformers==4.38.2 + - accelerate==0.27.2 + - albumentations==1.3.0 + - scikit-image==0.19.3 + - simplification==0.7.10 + - fairscale==0.4.13 +name: mlflow-env diff --git a/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/vision/conda_od.yaml b/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/vision/conda_od.yaml new file mode 100644 index 0000000000..738e6fd5f8 --- /dev/null +++ b/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/vision/conda_od.yaml @@ -0,0 +1,17 @@ +channels: +- conda-forge +dependencies: +- python=3.9.19 +- pip<=24.0 +- pip: + - mlflow==2.12.1 + - cloudpickle==2.2.1 + - datasets==2.15.0 + - openmim==0.3.9 + - torch==2.0.1 + - torchvision==0.15.2 + - transformers==4.38.2 + - accelerate==0.27.2 + - albumentations==1.3.0 + - fairscale==0.4.13 +name: mlflow-env