:((((
This commit is contained in:
parent
f2e1563198
commit
1c47e59902
18
Jenkinsfile-from-registry
Normal file
18
Jenkinsfile-from-registry
Normal file
@ -0,0 +1,18 @@
|
||||
pipeline {
|
||||
agent {
|
||||
dockerfile true
|
||||
}
|
||||
|
||||
stage('predict')
|
||||
{
|
||||
steps
|
||||
{
|
||||
catchError {
|
||||
sh 'ls -al'
|
||||
sh 'python3 predict434788-from-registry.py'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
20
predict434788-from-registry.py
Normal file
20
predict434788-from-registry.py
Normal file
@ -0,0 +1,20 @@
|
||||
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 = "s434788"
|
||||
for mv in client.search_model_versions(f"name='{model_name}'"):
|
||||
if int(mv.version) > version:
|
||||
version = int(mv.version)
|
||||
|
||||
model = mlflow.keras.load_model(
|
||||
model_uri=f"models:/{model_name}/{version}"
|
||||
)
|
||||
|
||||
data = pd.read_json('my_model/input_example.json', orient='index')
|
||||
|
||||
print(data)
|
||||
print(model.predict(data))
|
Loading…
Reference in New Issue
Block a user