You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/how-to-deploy-to-aci/how-to-deploy-to-aci.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,10 @@
6
6
7
7
# PREREQ: load workspace info
8
8
# import azureml.core
9
-
# <load-workspace>
9
+
#region load-workspace
10
10
fromazureml.coreimportWorkspace
11
11
ws=Workspace.from_config()
12
-
# </load-workspace>
12
+
#endregion
13
13
14
14
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())"
0 commit comments