ium_s449288/predict_artifact.py
2022-05-14 13:03:16 +02:00

18 lines
362 B
Python

import mlflow
import numpy as np
import json
artifact_path = 'mlruns/1//artifacts/model' #
model = mlflow.pyfunc.load_model(artifact_path) #
with open(f'{model}/input_example.json') as f:
input_example_data = json.load(f)
input_example = np.array() #
print(f'Input example: {input_example}')
print(f'Model prediction: {model.predict(input_example)}')