ium_434760/try_model.py
2021-05-24 01:48:11 +02:00

15 lines
392 B
Python

import mlflow
import pandas as pd
import json
model = mlflow.keras.load_model("my_model")
data = None
try:
with open('input.json') as json_file:
data = json.load(json_file)
except:
with open('my_model/input_example.json') as json_file:
data = json.load(json_file)
with open('result.txt', 'w+', encoding="UTF-8") as f:
f.write(str(model.predict([data["inputs"]])))