From 2516052abb962082ab4150c789a1a3b7c30a04a4 Mon Sep 17 00:00:00 2001 From: Kamila Date: Sun, 15 May 2022 13:40:36 +0200 Subject: [PATCH] mlflow attempt task 2 prediction registry --- predict_registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/predict_registry.py b/predict_registry.py index f5956b6..94885e4 100644 --- a/predict_registry.py +++ b/predict_registry.py @@ -7,6 +7,7 @@ import sys PATH = "/mlruns/14/80fe21a0804844088147d15a3cebb3e5/artifacts/lego-model" model = mlflow.pyfunc.load_model(PATH) -with open(f'{model}/{(sys.argv[1:])[0]}', 'r') as file: +input = str((sys.argv[1:])[0]) +with open(f'{PATH}/{input}', 'r') as file: json_data = json.load(file) print(f"Prediction: {model.predict(np.array([json_data['inputs']]))}")