update dockerfile, add predict.py, jenkinsfile_predict
This commit is contained in:
parent
a6e7769e8d
commit
3e9f82b3ea
@ -37,6 +37,7 @@ COPY Biblioteka_DL/dllib.py .
|
|||||||
COPY Biblioteka_DL/dllib-sacred.py .
|
COPY Biblioteka_DL/dllib-sacred.py .
|
||||||
COPY Biblioteka_DL/evaluate.py .
|
COPY Biblioteka_DL/evaluate.py .
|
||||||
COPY Biblioteka_DL/dllib-mlflow.py .
|
COPY Biblioteka_DL/dllib-mlflow.py .
|
||||||
|
COPY predict.py .
|
||||||
COPY Biblioteka_DL/all_games.csv .
|
COPY Biblioteka_DL/all_games.csv .
|
||||||
|
|
||||||
RUN ./download.sh $CUTOFF
|
RUN ./download.sh $CUTOFF
|
||||||
|
16
Jenkinsfile_predict
Normal file
16
Jenkinsfile_predict
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
dockerfile {
|
||||||
|
additionalBuildArgs "--build-arg KAGGLE_USERNAME=${params.KAGGLE_USERNAME} --build-arg KAGGLE_KEY=${params.KAGGLE_KEY} --build-arg CUTOFF=${params.CUTOFF} -t maciejczajka"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Script') {
|
||||||
|
steps {
|
||||||
|
copyArtifacts filter: '*', projectName: 's444409-training/master', selector: lastSuccessful()
|
||||||
|
sh "python predict.py"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
predict.py
Normal file
16
predict.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import json
|
||||||
|
import mlflow
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
|
||||||
|
#logged_model = 'mlruns/1/d5b6f9c1784a4d2dbb8592cd4ad364d7/artifacts/model'
|
||||||
|
logged_model = 'mlruns/1/fa3e620f03e64d888c364827907fb6f5/artifacts/s444409'
|
||||||
|
loaded_model = mlflow.pyfunc.load_model(logged_model)
|
||||||
|
|
||||||
|
|
||||||
|
with open(f'{logged_model}/input_example.json') as f:
|
||||||
|
data = json.load(f)
|
||||||
|
input_example = pd.DataFrame(data['inputs'][0])
|
||||||
|
|
||||||
|
|
||||||
|
loaded_model.predict(input_example)
|
Loading…
Reference in New Issue
Block a user