mlflow
This commit is contained in:
parent
ff05e16b84
commit
da4bd8e58c
23
s444356-reg.Jenkinsfile
Normal file
23
s444356-reg.Jenkinsfile
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'zadanie'
|
||||||
|
args '-v /mlruns:/mlruns'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parameters {
|
||||||
|
buildSelector(
|
||||||
|
defaultSelector: lastSuccessful(),
|
||||||
|
description: 'Which build to use for copying artifacts',
|
||||||
|
name: 'BUILD_SELECTOR'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Prediction') {
|
||||||
|
steps {
|
||||||
|
sh 'python s444356-reg.py'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
s444356-reg.py
Normal file
12
s444356-reg.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import json
|
||||||
|
import mlflow
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
path = '/mlruns/13/da5c6167bb45403fa35569849a1fbc13/artifacts/model'
|
||||||
|
model = mlflow.pyfunc.load_model(path)
|
||||||
|
|
||||||
|
with open(f'{path}/input_example.json') as file:
|
||||||
|
data = json.load(file)
|
||||||
|
input_example = np.array([data['inputs']]).reshape(-1, 2)
|
||||||
|
print('Input:\n', input_example)
|
||||||
|
print('Predictions:\n', model.predict(input_example))
|
Loading…
Reference in New Issue
Block a user