2021-05-23 16:21:50 +02:00
|
|
|
|
|
|
|
import json
|
|
|
|
import mlflow
|
|
|
|
import pandas as pd
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
arguments = sys.argv[1:]
|
|
|
|
|
|
|
|
input = str(arguments[0])
|
|
|
|
|
2021-05-23 16:57:24 +02:00
|
|
|
model = mlflow.pytorchg.load_model("my_model")
|
2021-05-23 16:21:50 +02:00
|
|
|
|
|
|
|
with open('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.predict(pd.DataFrame([data_into_dict])))
|