15 lines
441 B
Python
15 lines
441 B
Python
import json
|
|
import mlflow
|
|
import pandas as pd
|
|
|
|
logged_model = 'mlruns/1/fa3e620f03e64d888c364827907fb6f5/artifacts/s444409'
|
|
logged_model2 = 'mlruns/1/fa3e620f03e64d888c364827907fb6f5/artifacts/s444409/data/model.pth'
|
|
loaded_model = mlflow.pyfunc.load_model(logged_model2)
|
|
|
|
|
|
with open(f'{logged_model}/input_example.json') as f:
|
|
data = json.load(f)
|
|
input_example = pd.DataFrame(data['inputs'][0])
|
|
|
|
|
|
loaded_model.predict(input_example) |