ium_444356/predict.py
Maciej Czajka 245aa17202
All checks were successful
s444356-evaluation/pipeline/head This commit looks good
s444356-training/pipeline/head This commit looks good
update predict.py
2022-05-11 19:53:52 +02:00

14 lines
295 B
Python

import json
import mlflow
import sys
input = sys.argv[1]
logged_model = 'mlruns/1/3630068c31924c05a9a04e70ef35e0b8/artifacts/s444409'
loaded_model = mlflow.pyfunc.load_model(logged_model)
with open(f'{logged_model}/'+input) as f:
data = json.load(f)
loaded_model.predict(data['inputs'])