Skip to content

Commit 7c9e2f8

Browse files
authored
ref for score.py file
1 parent 9e05923 commit 7c9e2f8

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

azML-modelcreation/README.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -242,28 +242,9 @@ https://github.com/user-attachments/assets/a82ff03e-437c-41bc-85fa-8b9903384a5b
242242
243243
## Step 9: Deploy the Model
244244

245-
> Create the Scoring Script:
245+
> Create the scoring script as demonstrated in the video below. Click to see a more detailed [sample of the scoring file with debugs and logs included](./src/score.py)
246246
247-
```python
248-
import joblib
249-
import numpy as np
250-
from azureml.core.model import Model
251-
252-
def init():
253-
global model
254-
model_path = Model.get_model_path("my_model_RegressionModel")
255-
model = joblib.load(model_path)
256-
257-
def run(data):
258-
try:
259-
input_data = np.array(data["data"])
260-
result = model.predict(input_data)
261-
return result.tolist()
262-
except Exception as e:
263-
return str(e)
264-
```
265-
266-
https://github.com/user-attachments/assets/cdc64857-3bde-4ec9-957d-5399d9447813
247+
https://github.com/user-attachments/assets/cdc64857-3bde-4ec9-957d-5399d9447813
267248

268249
> Create the Environment File (env.yaml):
269250

0 commit comments

Comments
 (0)