ium_s449288/predict_artifact.py

15 lines
428 B
Python

import mlflow
import numpy as np
import json
artifact_path = 'mlruns_s444417/1/169f2bf3d53f4de088c494e889c6e65a/artifacts/model'
model = mlflow.pyfunc.load_model(artifact_path)
with open(f'input_example.json') as f:
input_example_data = json.load(f)
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)}')