ium_478839/prediction-s444409.py

16 lines
406 B
Python
Raw Normal View History

2022-06-25 15:26:56 +02:00
import json
import mlflow
import sys
import numpy as np
#input = sys.argv[1]
2022-06-25 16:04:26 +02:00
# logged_model = 'mlruns/1/70439eb482b54d56b54b0ecc6f1ca96f/artifacts/s444409'
# loaded_model = mlflow.pyfunc.load_model(logged_model)
2022-06-25 15:26:56 +02:00
with open('input_example.json') as f:
data = json.load(f)
input_example = np.array([data['inputs'][0]], dtype=np.float32)
print(f'Prediction: {loaded_model.predict(input_example)}')