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