Skip to content

Commit 111f5e8

Browse files
committed
playing around
1 parent 96c59d5 commit 111f5e8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/how-to-deploy-to-aci/how-to-deploy-to-aci.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66

77
# PREREQ: load workspace info
88
# import azureml.core
9-
#region load-workspace
9+
10+
# <load>
1011
from azureml.core import Workspace
1112
ws = Workspace.from_config()
12-
#endregion
13+
# </load>
1314

1415
scorepy_content = "import json\nimport numpy as np\nimport os\nimport pickle\nfrom sklearn.externals import joblib\nfrom sklearn.linear_model import LogisticRegression\n\nfrom azureml.core.model import Model\n\ndef init():\n global model\n # retreive the path to the model file using the model name\n model_path = Model.get_model_path('sklearn_mnist')\n model = joblib.load(model_path)\n\ndef run(raw_data):\n data = np.array(json.loads(raw_data)['data'])\n # make prediction\n y_hat = model.predict(data)\n return json.dumps(y_hat.tolist())"
1516
print(scorepy_content)
@@ -26,7 +27,7 @@
2627
with open("myenv.yml","w") as f:
2728
f.write(myenv.serialize_to_string())
2829

29-
#Region config-image
30+
#<config-image?
3031
from azureml.core.image import ContainerImage
3132

3233
image_config = ContainerImage.image_configuration(execution_script = "score.py",
@@ -35,7 +36,7 @@
3536
description = "Image with mnist model",
3637
tags = {"data": "mnist", "type": "classification"}
3738
)
38-
#End Region
39+
#</config-image>
3940

4041
# <config-aci>
4142
from azureml.core.webservice import AciWebservice

0 commit comments

Comments
 (0)