diff --git a/sdk/python/jobs/pipelines/1h_automl_in_pipeline/automl-forecasting-in-pipeline/automl-forecasting-in-pipeline.ipynb b/sdk/python/jobs/pipelines/1h_automl_in_pipeline/automl-forecasting-in-pipeline/automl-forecasting-in-pipeline.ipynb index 6ed569f9823..eb918f7885e 100644 --- a/sdk/python/jobs/pipelines/1h_automl_in_pipeline/automl-forecasting-in-pipeline/automl-forecasting-in-pipeline.ipynb +++ b/sdk/python/jobs/pipelines/1h_automl_in_pipeline/automl-forecasting-in-pipeline/automl-forecasting-in-pipeline.ipynb @@ -392,6 +392,7 @@ "source": [ "model_name_str = \"ojmodel\"\n", "\n", + "\n", "# Define pipeline\n", "@pipeline(\n", " description=\"AutoML Forecasting Pipeline\",\n", @@ -644,7 +645,32 @@ "metadata": {}, "source": [ "## 3.1 Get Inference Pipeline Environment\n", - "This environment can be created using the `yaml` file, which we have downloaded with other best run's artifacts into the `artifact_downloads` directory." + "This environment can be created using the `yaml` file, which we have downloaded with other best run's artifacts into the `artifact_downloads` directory.
\n", + "We will use workaround to update cmdstanpy in the conda environment file." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import yaml\n", + "\n", + "conda_path = os.path.join(\"artifact_downloads\", \"outputs\", \"conda_env_v_1_0_0.yml\")\n", + "with open(conda_path, \"r\") as f:\n", + " dependencies = yaml.safe_load(f)\n", + "dependencies[\"dependencies\"][1][\"pip\"].append(\"cmdstanpy==1.2.0\")\n", + "conda_updated = os.path.join(\"artifact_downloads\", \"outputs\", \"conda_updated.yml\")\n", + "with open(conda_updated, \"w\") as f:\n", + " yaml.dump(dependencies, f)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Filally, load the modified environment." ] }, { @@ -656,9 +682,10 @@ "from azure.ai.ml.entities import Environment\n", "\n", "env = Environment(\n", + " name=\"oj-inference-env\",\n", " description=\"environment for automl inference\",\n", " image=\"mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04:latest\",\n", - " conda_file=os.path.join(\"artifact_downloads\", \"outputs\", \"conda_env_v_1_0_0.yml\"),\n", + " conda_file=conda_updated,\n", ")" ] }, @@ -683,6 +710,8 @@ "outputs": [], "source": [ "output_ds_name = \"oj-output\"\n", + "\n", + "\n", "# Define inference pipeline\n", "@pipeline(\n", " description=\"AutoML Inference Pipeline\",\n",