19 lines
445 B
Python
19 lines
445 B
Python
import mlflow as mlf
|
|
import json
|
|
import mlflow as mlf
|
|
import pandas as pd
|
|
|
|
model_name = "movies_imdb"
|
|
model_version = 1
|
|
|
|
model = mlf.pyfunc.load_model(
|
|
model_uri=f"models:/{model_name}/{model_version}"
|
|
)
|
|
|
|
with open('movies_imdb/input_example.json', 'r') as datafile:
|
|
data = json.load(datafile)['inputs']
|
|
|
|
input_dictionary = {idx:x for idx, x in enumerate(data)}
|
|
input_ex = pd.DataFrame([input_dictionary])
|
|
print(model.predict(input_ex))
|