Lab 3 - Deploy your model
1. Deploy to an Azure Container Instance
Download the scoring script
inference_folder = "./inference"
inference_script_url = "https://raw.githubusercontent.com/hnky/DevelopersGuideToAI/master/amls/resources/score.py"
inference_script_download_path = os.path.join(inference_folder,"score.py")
if not os.path.exists(inference_folder):
os.mkdir(inference_folder);
urllib.request.urlretrieve(inference_script_url, filename=inference_script_download_path)Create an inference environment
inference_env = Environment(name="simpsons-inference")
conda_dep = CondaDependencies()
conda_dep.add_pip_package("azureml-defaults")
conda_dep.add_pip_package("torch")
conda_dep.add_pip_package("torchvision")
conda_dep.add_pip_package("pillow==5.4.1")
inference_env.python.conda_dependencies=conda_depCreate an Inference config
Create a Azure Container Instance deployment config
Deploy the model to an ACI

2. Test the model in the API
Post an image to the endpoint
Use Postman

Try other images
Last updated