ium_444356/predict.py

14 lines
304 B
Python
Raw Normal View History

import json
import mlflow
import pandas as pd
2022-05-11 19:33:00 +02:00
input = sys.argv[1]
2022-05-11 19:10:13 +02:00
logged_model = 'mlruns/1/fa3e620f03e64d888c364827907fb6f5/artifacts/s444409'
2022-05-11 19:33:00 +02:00
loaded_model = mlflow.pyfunc.load_model(logged_model)
2022-05-11 19:33:00 +02:00
with open(f'{logged_model}/'+input) as f:
data = json.load(f)
2022-05-11 19:33:00 +02:00
loaded_model.predict(data['inputs'])