fix mlflow directory mlruns
This commit is contained in:
parent
3a8116d6a9
commit
611f1199e0
@ -1,7 +1,12 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {dockerfile true}
|
agent {
|
||||||
|
docker {
|
||||||
|
image 's430804/ium:0.5'
|
||||||
|
args '-v /tmp/mlruns:/tmp/mlruns -v /mlruns:/mlruns '
|
||||||
|
}
|
||||||
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('training') {
|
stage('Predict model from partner mlflow') {
|
||||||
steps {
|
steps {
|
||||||
sh 'chmod +x pred_from_mlflow_model.py'
|
sh 'chmod +x pred_from_mlflow_model.py'
|
||||||
sh 'python3 pred_from_mlflow_model.py'
|
sh 'python3 pred_from_mlflow_model.py'
|
||||||
|
@ -1,14 +1,20 @@
|
|||||||
import json
|
import json
|
||||||
import mlflow as mlf
|
import mlflow as mlf
|
||||||
|
from mlflow.tracking import MlflowClient
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
model_name = "s430705"
|
model_name = "s430705"
|
||||||
model_version = 8
|
model_version = 30
|
||||||
mlf.set_tracking_uri("http://172.17.0.1:5000")
|
mlf.set_tracking_uri("http://172.17.0.1:5000")
|
||||||
model = mlf.pyfunc.load_model(
|
model = mlf.pyfunc.load_model(
|
||||||
model_uri=f"models:/{model_name}/{model_version}"
|
model_uri=f"models:/{model_name}/{model_version}"
|
||||||
)
|
)
|
||||||
with open('movies_imdb2/input_example.json', 'r') as datafile:
|
|
||||||
|
client = MlflowClient()
|
||||||
|
models_version = client.search_model_versions("name='s430705'")
|
||||||
|
input_path = models_version[-1].source
|
||||||
|
|
||||||
|
with open(f'{input_path}/input_example.json', 'r') as datafile:
|
||||||
data = json.load(datafile)['inputs']
|
data = json.load(datafile)['inputs']
|
||||||
|
|
||||||
input_dictionary = {idx:x for idx, x in enumerate(data)}
|
input_dictionary = {idx:x for idx, x in enumerate(data)}
|
||||||
|
Loading…
Reference in New Issue
Block a user