Created
July 19, 2022 03:19
-
-
Save IntegerMan/dda38e679b1c98ffbf1736218d3feb50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from azureml.core import Environment | |
from azureml.core.model import InferenceConfig | |
# Load the environment from the YAML file downloaded from the best run | |
env = Environment.from_conda_specification("AutoML-env", "automl-output/outputs/conda_env_v_1_0_0.yml") | |
# Create an inference config pointing at the files we downloaded. This configuration tells Azure how to handle requests | |
inference_config = InferenceConfig(environment=env, | |
source_directory='./automl-output/outputs', | |
entry_script='./scoring_file_v_2_0_0.py') | |
# The deployment configuration configures how the endpoint is hosted | |
deployment_config = AciWebservice.deploy_configuration( | |
cpu_cores = 1, | |
memory_gb = 1, | |
enable_app_insights=True, | |
auth_enabled=False) | |
# Deploy the model | |
service = Model.deploy(ws, "endpoint-name", [automl_model], inference_config, deployment_config, overwrite=True) | |
service.wait_for_deployment(show_output = True) | |
# Grab our scoring endpoint for testing | |
print('Endpoint active at ' + service.scoring_uri) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment