diff --git a/mlflow_prediction.py b/mlflow_prediction.py index e1a8140..32c7efb 100644 --- a/mlflow_prediction.py +++ b/mlflow_prediction.py @@ -1,6 +1,8 @@ import json import mlflow +import torch +import numpy as np import pandas as pd import sys @@ -14,5 +16,4 @@ model = mlflow.pytorch.load_model("my_model") with open(f'my_model/{input}', 'r') as file: json_data = json.load(file)['inputs'] -data_into_dict = {idx:x for idx, x in enumerate(json_data)} -print(model(pd.DataFrame([data_into_dict]))) \ No newline at end of file +print(model(torch.tensor(np.array(json_data['inputs'])).float())) \ No newline at end of file