mlflow attempt task 2 prediction registry

This commit is contained in:
Kamila 2022-05-15 13:40:36 +02:00
parent 4e4c2fd1ef
commit 2516052abb
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import sys
PATH = "/mlruns/14/80fe21a0804844088147d15a3cebb3e5/artifacts/lego-model"
model = mlflow.pyfunc.load_model(PATH)
with open(f'{model}/{(sys.argv[1:])[0]}', 'r') as file:
input = str((sys.argv[1:])[0])
with open(f'{PATH}/{input}', 'r') as file:
json_data = json.load(file)
print(f"Prediction: {model.predict(np.array([json_data['inputs']]))}")