ium_434704/mlflow_prediction.py
Wojciech Jarmosz 091c794e5e
All checks were successful
s434704-predict-s426206/pipeline/head This commit looks good
Clean prints
2021-05-23 19:10:36 +02:00

20 lines
336 B
Python

import json
import mlflow
import torch
import numpy as np
import pandas as pd
import sys
arguments = sys.argv[1:]
input = str(arguments[0])
model = mlflow.pytorch.load_model("my_model")
with open(f'my_model/{input}', 'r') as file:
json_data = json.load(file)
print(model(torch.tensor(np.array(json_data['inputs'])).float()))