update samples from Release-165 as a part of 1.0.81 SDK release

This commit is contained in:
vizhur
2019-12-24 00:34:24 +00:00
parent 8f4efe15eb
commit 0772c157a8
29 changed files with 1124 additions and 152 deletions

View File

@@ -328,6 +328,7 @@
"\n",
"myenv = CondaDependencies()\n",
"myenv.add_conda_package(\"scikit-learn\")\n",
"myenv.add_pip_package(\"azureml-defaults\")\n",
"\n",
"with open(\"myenv.yml\",\"w\") as f:\n",
" f.write(myenv.serialize_to_string())"
@@ -387,13 +388,11 @@
"\n",
"Configure the image and deploy. The following code goes through these steps:\n",
"\n",
"1. Build an image using:\n",
"1. Create environment object containing dependencies needed by the model using the environment file (`myenv.yml`)\n",
"1. Create inference configuration necessary to deploy the model as a web service using:\n",
" * The scoring file (`score.py`)\n",
" * The environment file (`myenv.yml`)\n",
" * The model file\n",
"1. Register that image under the workspace. \n",
"1. Send the image to the ACI container.\n",
"1. Start up a container in ACI using the image.\n",
" * envrionment object created in previous step\n",
"1. Deploy the model to the ACI container.\n",
"1. Get the web service HTTP endpoint."
]
},
@@ -413,10 +412,11 @@
"%%time\n",
"from azureml.core.webservice import Webservice\n",
"from azureml.core.model import InferenceConfig\n",
"from azureml.core.environment import Environment\n",
"\n",
"inference_config = InferenceConfig(runtime= \"python\", \n",
" entry_script=\"score.py\",\n",
" conda_file=\"myenv.yml\")\n",
"\n",
"myenv = Environment.from_conda_specification(name=\"myenv\", file_path=\"myenv.yml\")\n",
"inference_config = InferenceConfig(entry_script=\"score.py\", environment=myenv)\n",
"\n",
"service = Model.deploy(workspace=ws, \n",
" name='sklearn-mnist-svc', \n",