Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
testing
  • Loading branch information
sdgilley committed Oct 17, 2018
commit 96c59d5c2b966d7f849a702ea344cb3c63da5e13
12 changes: 6 additions & 6 deletions docs/how-to-deploy-to-aci/how-to-deploy-to-aci.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

# PREREQ: load workspace info
# import azureml.core
# <load-workspace>
#region load-workspace
from azureml.core import Workspace
ws = Workspace.from_config()
# </load-workspace>
#endregion

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())"
print(scorepy_content)
Expand All @@ -26,7 +26,7 @@
with open("myenv.yml","w") as f:
f.write(myenv.serialize_to_string())

# <config-image>
#Region config-image
from azureml.core.image import ContainerImage

image_config = ContainerImage.image_configuration(execution_script = "score.py",
Expand All @@ -35,7 +35,7 @@
description = "Image with mnist model",
tags = {"data": "mnist", "type": "classification"}
)
# </config-image>
#End Region

# <config-aci>
from azureml.core.webservice import AciWebservice
Expand All @@ -46,7 +46,7 @@
description = 'Handwriting recognition')
# </config-aci>

# <register-model>
#<register-model>
from azureml.core.model import Model

model_name = "sklearn_mnist"
Expand All @@ -55,7 +55,7 @@
tags = {"data": "mnist", "type": "classification"},
description = "Mnist handwriting recognition",
workspace = ws)
# </register-model>
#</register-model>

# <retrieve-model>
from azureml.core.model import Model
Expand Down