Próba z pliku

This commit is contained in:
Anna Nowak 2021-05-24 01:48:11 +02:00
parent f6a9e8a5c6
commit fbb9ac6a26
2 changed files with 10 additions and 6 deletions

View File

@ -1,6 +1,6 @@
pipeline { pipeline {
agent { agent {
docker { image 'adnovac/ium_s434760:4' } docker { image 'adnovac/ium_s434760:4.1' }
} }
parameters{ parameters{
buildSelector( buildSelector(
@ -20,17 +20,16 @@ pipeline {
steps steps
{ {
copyArtifacts(fingerprintArtifacts: true, projectName: 's434788-training/mlflow', selector: buildParameter('WHICH_BUILD')) copyArtifacts(fingerprintArtifacts: true, projectName: 's434788-training/mlflow', selector: buildParameter('WHICH_BUILD'))
sh "echo ${json_input} >> input.json"
} }
} }
stage('test') stage('test')
{ {
steps steps
{ {
catchError {
sh 'python3.8 try_model.py' sh 'python3.8 try_model.py'
} }
} }
}
stage('archive artifacts') { stage('archive artifacts') {
steps { steps {
archiveArtifacts 'result.txt' archiveArtifacts 'result.txt'

View File

@ -3,6 +3,11 @@ import pandas as pd
import json import json
model = mlflow.keras.load_model("my_model") model = mlflow.keras.load_model("my_model")
data = None
try:
with open('input.json') as json_file:
data = json.load(json_file)
except:
with open('my_model/input_example.json') as json_file: with open('my_model/input_example.json') as json_file:
data = json.load(json_file) data = json.load(json_file)