From 764d8fc48c364d0e2b5110e00512ea125559915c Mon Sep 17 00:00:00 2001 From: Lu Peng Date: Fri, 8 Sep 2023 16:42:55 -0400 Subject: [PATCH] Added compartment id environment variable while running in pipeline run. --- ads/model/generic_model.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ads/model/generic_model.py b/ads/model/generic_model.py index 127b8ad1b..7ec241c1d 100644 --- a/ads/model/generic_model.py +++ b/ads/model/generic_model.py @@ -29,6 +29,7 @@ JOB_RUN_OCID, NB_SESSION_COMPARTMENT_OCID, NB_SESSION_OCID, + PIPELINE_RUN_COMPARTMENT_OCID, PROJECT_OCID, ) from ads.evaluations import EvaluatorMixin @@ -91,7 +92,11 @@ from ads.model.transformer.onnx_transformer import ONNXTransformer _TRAINING_RESOURCE_ID = JOB_RUN_OCID or NB_SESSION_OCID -_COMPARTMENT_OCID = NB_SESSION_COMPARTMENT_OCID or JOB_RUN_COMPARTMENT_OCID +_COMPARTMENT_OCID = ( + NB_SESSION_COMPARTMENT_OCID + or JOB_RUN_COMPARTMENT_OCID + or PIPELINE_RUN_COMPARTMENT_OCID +) MODEL_DEPLOYMENT_INSTANCE_SHAPE = "VM.Standard.E4.Flex" MODEL_DEPLOYMENT_INSTANCE_OCPUS = 1