2022-05-15 13:24:08 +02:00
|
|
|
import json
|
|
|
|
import mlflow
|
|
|
|
import numpy as np
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
2022-05-15 13:30:37 +02:00
|
|
|
PATH = "/mlruns/14/80fe21a0804844088147d15a3cebb3e5/artifacts/lego-model"
|
2022-05-15 13:36:03 +02:00
|
|
|
model = mlflow.pyfunc.load_model(PATH)
|
2022-05-15 13:24:08 +02:00
|
|
|
|
2022-05-15 13:40:36 +02:00
|
|
|
input = str((sys.argv[1:])[0])
|
|
|
|
with open(f'{PATH}/{input}', 'r') as file:
|
2022-05-15 13:24:08 +02:00
|
|
|
json_data = json.load(file)
|
2022-05-15 13:36:03 +02:00
|
|
|
print(f"Prediction: {model.predict(np.array([json_data['inputs']]))}")
|