|
36 | 36 |
|
37 | 37 | # Get the latest model details |
38 | 38 |
|
39 | | -try: |
40 | | - with open("aml_config/model.json") as f: |
41 | | - config = json.load(f) |
42 | | -except: |
43 | | - print("No new model to register thus no need to create new scoring image") |
44 | | - # raise Exception('No new model to register as production model perform better') |
45 | | - sys.exit(0) |
| 39 | +# try: |
| 40 | +# with open("aml_config/model.json") as f: |
| 41 | +# config = json.load(f) |
| 42 | +# except: |
| 43 | +# print("No new model to register thus no need to create new scoring image") |
| 44 | +# # raise Exception('No new model to register as production model perform better') |
| 45 | +# sys.exit(0) |
46 | 46 |
|
47 | | -model_name = config["model_name"] |
48 | | -model_version = config["model_version"] |
| 47 | +# model_name = config["model_name"] |
| 48 | +# model_version = config["model_version"] |
49 | 49 |
|
50 | 50 |
|
51 | | -model_list = Model.list(workspace=ws) |
52 | | -model, = (m for m in model_list if m.version == model_version and m.name == model_name) |
53 | | -print( |
54 | | - "Model picked: {} \nModel Description: {} \nModel Version: {}".format( |
55 | | - model.name, model.description, model.version |
56 | | - ) |
57 | | -) |
| 51 | +# model_list = Model.list(workspace=ws) |
| 52 | +# model, = (m for m in model_list if m.version == model_version and m.name == model_name) |
| 53 | +# print( |
| 54 | +# "Model picked: {} \nModel Description: {} \nModel Version: {}".format( |
| 55 | +# model.name, model.description, model.version |
| 56 | +# ) |
| 57 | +# ) |
| 58 | + |
| 59 | +model_name = "sklearn_regression_model.pkl" |
| 60 | +model = Model(ws, name=model_name) |
58 | 61 |
|
59 | 62 | os.chdir("./code/scoring") |
60 | 63 | image_name = "diabetes-model-score" |
61 | 64 |
|
62 | 65 | image_config = ContainerImage.image_configuration( |
63 | 66 | execution_script="score.py", |
64 | | - runtime="python-slim", |
| 67 | + runtime="python", |
65 | 68 | conda_file="conda_dependencies.yml", |
66 | 69 | description="Image with ridge regression model", |
67 | 70 | tags={"area": "diabetes", "type": "regression"}, |
|
0 commit comments