20 lines
510 B
Python
20 lines
510 B
Python
|
from mlflow.tracking import MlflowClient
|
||
|
import mlflow
|
||
|
import pandas as pd
|
||
|
|
||
|
mlflow.set_tracking_uri("http://172.17.0.1:5000")
|
||
|
client = MlflowClient()
|
||
|
version = 0
|
||
|
model_name = "s434695"
|
||
|
for mv in client.search_model_versions(f"name='{model_name}'"):
|
||
|
if int(mv.version) > version:
|
||
|
version = int(mv.version)
|
||
|
|
||
|
model = mlflow.pytorch.load_model(
|
||
|
model_uri=f"models:/{model_name}/{version}"
|
||
|
)
|
||
|
|
||
|
data = pd.read_json('my_model/input_example.json', orient='split')
|
||
|
|
||
|
print(data)
|
||
|
print(model.predict(data))
|