From 657d00fda3c123d9c93552faade426e07450d595 Mon Sep 17 00:00:00 2001 From: Kacper Dudzic Date: Sat, 14 May 2022 15:24:56 +0200 Subject: [PATCH] Update 'predict_artifact.py' --- predict_artifact.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/predict_artifact.py b/predict_artifact.py index d33f133..babf30c 100644 --- a/predict_artifact.py +++ b/predict_artifact.py @@ -2,16 +2,13 @@ import mlflow import numpy as np import json -artifact_path = 'mlruns/1//artifacts/model' # -model = mlflow.pyfunc.load_model(artifact_path) # +artifact_path = 'mlruns/1/169f2bf3d53f4de088c494e889c6e65a/artifacts/model' +model = mlflow.pyfunc.load_model(artifact_path) -with open(f'{model}/input_example.json') as f: +with open(f'input_example.json') as f: input_example_data = json.load(f) -input_example = np.array() # +input_example = np.array(input_example_data['inputs']).reshape(-1, 8) print(f'Input example: {input_example}') print(f'Model prediction: {model.predict(input_example)}') - - -