31201b169b
Some checks failed
s434704-predict-s426206/pipeline/head There was a failure building this commit
18 lines
360 B
Python
18 lines
360 B
Python
|
|
import json
|
|
import mlflow
|
|
import pandas as pd
|
|
|
|
import sys
|
|
|
|
arguments = sys.argv[1:]
|
|
|
|
input = str(arguments[0])
|
|
|
|
model = mlflow.pytorchg.load_model("my_model")
|
|
|
|
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]))) |