20 lines
336 B
Python
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()))
|