From 3f79d30979bc8118934f90b21533fc083ecc16af Mon Sep 17 00:00:00 2001 From: Roopa G Date: Mon, 9 Dec 2024 14:29:21 +0530 Subject: [PATCH] Rad Dino changes --- .../components/convert_model_to_mlflow/spec.yaml | 1 + .../training/model_management/components/import_model/spec.yaml | 1 + .../src/azureml/model/mgmt/processors/factory.py | 2 +- .../src/azureml/model/mgmt/processors/pyfunc/config.py | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/training/model_management/components/convert_model_to_mlflow/spec.yaml b/assets/training/model_management/components/convert_model_to_mlflow/spec.yaml index 3b9885517b..7a4035fb95 100644 --- a/assets/training/model_management/components/convert_model_to_mlflow/spec.yaml +++ b/assets/training/model_management/components/convert_model_to_mlflow/spec.yaml @@ -79,6 +79,7 @@ inputs: - mask-generation - video-multi-object-tracking - visual-question-answering + - embeddings description: A Hugging face task on which model was trained on. A required parameter for transformers MLflow flavor. Can be provided as input here or in model_download_metadata JSON file. optional: true diff --git a/assets/training/model_management/components/import_model/spec.yaml b/assets/training/model_management/components/import_model/spec.yaml index 709105add4..4a03ea1fd3 100644 --- a/assets/training/model_management/components/import_model/spec.yaml +++ b/assets/training/model_management/components/import_model/spec.yaml @@ -100,6 +100,7 @@ inputs: - mask-generation - video-multi-object-tracking - visual-question-answering + - embeddings optional: true type: string diff --git a/assets/training/model_management/src/azureml/model/mgmt/processors/factory.py b/assets/training/model_management/src/azureml/model/mgmt/processors/factory.py index bb57653ebf..e1995d834f 100644 --- a/assets/training/model_management/src/azureml/model/mgmt/processors/factory.py +++ b/assets/training/model_management/src/azureml/model/mgmt/processors/factory.py @@ -72,7 +72,7 @@ def get_mlflow_convertor(model_framework, model_dir, output_dir, temp_dir, trans return CLIPMLflowConvertorFactory.create_mlflow_convertor( model_dir, output_dir, temp_dir, translate_params ) - elif (task == PyFuncSupportedTasks.EMBEDDINGS.value) and model_id.startswith(ModelFamilyPrefixes.DINOV2.value): + elif (task == PyFuncSupportedTasks.EMBEDDINGS.value) and (model_id.startswith(ModelFamilyPrefixes.DINOV2.value) or model_id.startswith(ModelFamilyPrefixes.RADDINO.value)): return DinoV2MLflowConvertorFactory.create_mlflow_convertor( model_dir, output_dir, temp_dir, translate_params ) diff --git a/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/config.py b/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/config.py index 6637ff1204..f6b9429b71 100644 --- a/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/config.py +++ b/assets/training/model_management/src/azureml/model/mgmt/processors/pyfunc/config.py @@ -65,3 +65,5 @@ class ModelFamilyPrefixes(_CustomEnum): # DinoV2 model family. DINOV2 = "facebook/dinov2" + + RADDINO = "microsoft/rad-dino" \ No newline at end of file