Skip to content

Commit 8cad85d

Browse files
committed
Merge branch 'rk/automl_nb_fix' of https://github.com/Azure/azureml-assets into rk/automl_nb_fix
2 parents a77ed12 + dd62a80 commit 8cad85d

File tree

2 files changed

+23
-4
lines changed
  • assets/training/finetune_acft_hf_nlp

2 files changed

+23
-4
lines changed

assets/training/finetune_acft_hf_nlp/components/pipeline_components/text_generation/spec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
$schema: https://azuremlschemas.azureedge.net/latest/pipelineComponent.schema.json
22
name: text_generation_pipeline
3-
version: 0.0.66
3+
version: 0.0.67
44
type: pipeline
55
display_name: Text Generation Pipeline
66
description: Pipeline component for text generation
@@ -566,7 +566,7 @@ jobs:
566566
auto_find_batch_size: '${{parent.inputs.auto_find_batch_size}}'
567567
text_generation_model_import:
568568
type: command
569-
component: azureml:text_generation_model_import:0.0.64
569+
component: azureml:text_generation_model_import:0.0.65
570570
compute: '${{parent.inputs.compute_model_import}}'
571571
resources:
572572
instance_type: '${{parent.inputs.instance_type_model_import}}'
@@ -578,7 +578,7 @@ jobs:
578578
system_properties: '${{parent.inputs.system_properties}}'
579579
text_generation_datapreprocess:
580580
type: command
581-
component: azureml:text_generation_datapreprocess:0.0.64
581+
component: azureml:text_generation_datapreprocess:0.0.65
582582
compute: '${{parent.inputs.compute_preprocess}}'
583583
resources:
584584
instance_type: '${{parent.inputs.instance_type_preprocess}}'
@@ -598,7 +598,7 @@ jobs:
598598
system_properties: '${{parent.inputs.system_properties}}'
599599
text_generation_finetune:
600600
type: command
601-
component: azureml:text_generation_finetune:0.0.64
601+
component: azureml:text_generation_finetune:0.0.65
602602
compute: '${{parent.inputs.compute_finetune}}'
603603
distribution:
604604
type: pytorch

assets/training/finetune_acft_hf_nlp/src/finetune/finetune.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,25 @@ def setup_vllm(task_name: str, finetune_config: Dict[str, Any], base_model_metad
811811
base image value is {removed_base_image}.")
812812
else:
813813
if base_model_metadata.get("azureml.base_image") is not None:
814+
# FT environment for chat-completion task is updated to transformers 4.46.3 and
815+
# FTed model tokenizers can't be loaded with transformers<4.45.0
816+
# Hence FMI version < 61 can't be used for deployments and Inferencing.
817+
# Currently force updating the image in finetune script.
818+
# After models are migrated to mcr.microsoft.com/azureml/curated/foundation-model-inference:61
819+
# remove the following code marked for removal, including comments
820+
# start of removal code
821+
if task_name == Tasks.CHAT_COMPLETION:
822+
try:
823+
base_vllm_image = str(base_model_metadata.get("azureml.base_image"))
824+
base_vllm_container, base_vllm_image_version = base_vllm_image.split(":")
825+
if int(base_vllm_image_version) < 61:
826+
logger.info("Updating the vllm inference container version.")
827+
base_model_metadata["azureml.base_image"] = base_vllm_container + ":61"
828+
except Exception:
829+
logger.info("Unable to fetch vllm inference container version, force updating the image.")
830+
base_model_metadata["azureml.base_image"] = \
831+
"mcr.microsoft.com/azureml/curated/foundation-model-inference:61"
832+
# end of removal code
814833
logger.info(
815834
"Adding inferencing base image {} for {} task.\
816835
".format(base_model_metadata.get("azureml.base_image"), task_name)

0 commit comments

Comments
 (0)