From db194a6d58b55f291daa4aeb12bed3a2305ec43c Mon Sep 17 00:00:00 2001 From: Kamila Date: Sun, 15 May 2022 13:36:03 +0200 Subject: [PATCH] mlflow attempt task 2 prediction registry --- predict_registry.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/predict_registry.py b/predict_registry.py index 62c9e68..f5956b6 100644 --- a/predict_registry.py +++ b/predict_registry.py @@ -5,15 +5,8 @@ import sys PATH = "/mlruns/14/80fe21a0804844088147d15a3cebb3e5/artifacts/lego-model" -model_version = 14 -model_name = "s449288" +model = mlflow.pyfunc.load_model(PATH) -model = mlflow.pyfunc.load_model( - model_uri=f"models:/{model_name}/{model_version}" -) - -with open(f'{PATH}/{(sys.argv[1:])[0]}', 'r') as file: +with open(f'{model}/{(sys.argv[1:])[0]}', 'r') as file: json_data = json.load(file) - print(f"Prediction: {model.predict(np.array([500]))}") - - \ No newline at end of file + print(f"Prediction: {model.predict(np.array([json_data['inputs']]))}")