From 06a2ec0cce3206c1847d9ac2f376b7035a3ada24 Mon Sep 17 00:00:00 2001 From: matthiasblondeel <32500173+matthiasblondeel@users.noreply.github.com> Date: Wed, 26 Feb 2025 06:26:47 -0800 Subject: [PATCH] [BugFix] : Small updates to merge component (#3869) Co-authored-by: Matthias Blondeel --- .../model_converters/medimage_embed_adapter_merge/spec.yaml | 2 +- .../pipeline_components/medimage_insight_ft/spec.yaml | 4 ++-- .../medimage_embed_adapter_merge/medimage_model_merge.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/training/finetune_acft_image/components/model_converters/medimage_embed_adapter_merge/spec.yaml b/assets/training/finetune_acft_image/components/model_converters/medimage_embed_adapter_merge/spec.yaml index cea48d522f..9268411722 100644 --- a/assets/training/finetune_acft_image/components/model_converters/medimage_embed_adapter_merge/spec.yaml +++ b/assets/training/finetune_acft_image/components/model_converters/medimage_embed_adapter_merge/spec.yaml @@ -1,7 +1,7 @@ $schema: https://azuremlschemas.azureedge.net/latest/commandComponent.schema.json type: command -version: 0.0.12 +version: 0.0.13 name: medimage_embedding_adapter_merge display_name: Merge Adapter Model with Embedding Generation Model description: Import and integrate Adapter and Embedding Generation Model diff --git a/assets/training/finetune_acft_image/components/pipeline_components/medimage_insight_ft/spec.yaml b/assets/training/finetune_acft_image/components/pipeline_components/medimage_insight_ft/spec.yaml index e24f0faef1..f7ad90ae68 100644 --- a/assets/training/finetune_acft_image/components/pipeline_components/medimage_insight_ft/spec.yaml +++ b/assets/training/finetune_acft_image/components/pipeline_components/medimage_insight_ft/spec.yaml @@ -1,6 +1,6 @@ $schema: https://azuremlschemas.azureedge.net/latest/pipelineComponent.schema.json name: medimage_insight_ft_pipeline -version: 0.0.14 +version: 0.0.16 type: pipeline display_name: Medical Image Insight Embedding Generator and Classification Adapter Pipeline description: Pipeline Component to finetune Hugging Face pretrained models for chat completion task. The component supports optimizations such as LoRA, Deepspeed and ONNXRuntime for performance enhancement. See [docs](https://aka.ms/azureml/components/chat_completion_pipeline) to learn more. @@ -406,7 +406,7 @@ jobs: max_epochs: '${{parent.inputs.max_epochs}}' medimage_embedding_adapter_merge: type: command - component: azureml://registries/mablonde-registry-101/components/medimage_embedding_adapter_merge/versions/0.0.12 + component: azureml://registries/mablonde-registry-101/components/medimage_embedding_adapter_merge/versions/0.0.13 compute: '${{parent.inputs.compute_finetune}}' resources: instance_type: '${{parent.inputs.instance_type_finetune}}' diff --git a/assets/training/finetune_acft_image/src/model_converters/medimage_embed_adapter_merge/medimage_model_merge.py b/assets/training/finetune_acft_image/src/model_converters/medimage_embed_adapter_merge/medimage_model_merge.py index 953e34a2a0..d30cb513a4 100644 --- a/assets/training/finetune_acft_image/src/model_converters/medimage_embed_adapter_merge/medimage_model_merge.py +++ b/assets/training/finetune_acft_image/src/model_converters/medimage_embed_adapter_merge/medimage_model_merge.py @@ -49,7 +49,7 @@ def merge_models(adapter_model_path, mlflow_model_path, output_dir, hidden_dimen logger.info(f"Copied {BEST_METRIC_MODEL} to {artifacts_dir}") with open(label_file, "r") as f: - labels = [l for l in f.read().splitlines() if not l.strip()] + labels = [l.strip() for l in f.read().splitlines() if l.strip()] config = { "hidden_dim": hidden_dimensions,