2021-05-24 01:40:00 +02:00
|
|
|
import mlflow
|
|
|
|
import pandas as pd
|
|
|
|
import json
|
|
|
|
|
|
|
|
model = mlflow.keras.load_model("my_model")
|
2021-05-24 01:48:11 +02:00
|
|
|
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)
|
2021-05-24 01:40:00 +02:00
|
|
|
|
|
|
|
with open('result.txt', 'w+', encoding="UTF-8") as f:
|
|
|
|
f.write(str(model.predict([data["inputs"]])))
|