ium_444356/predict.py
Maciej Czajka eda722bcfd
Some checks failed
s444356-evaluation/pipeline/head This commit looks good
s444356-training/pipeline/head There was a failure building this commit
update predict.py
2022-05-11 20:10:38 +02:00

16 lines
379 B
Python

import json
import mlflow
import sys
import numpy as np
input = sys.argv[1]
logged_model = 'mlruns/1/70439eb482b54d56b54b0ecc6f1ca96f/artifacts/s444409'
loaded_model = mlflow.pyfunc.load_model(logged_model)
with open(f'{logged_model}/'+input) as f:
data = json.load(f)
input_example = np.array([data['inputs']], dtype=np.float64)
loaded_model.predict(data['inputs'])