diff --git a/Jenkinsfile_mlflow b/Jenkinsfile_mlflow index fd518e0..4f7be00 100644 --- a/Jenkinsfile_mlflow +++ b/Jenkinsfile_mlflow @@ -16,8 +16,13 @@ pipeline { stage('training') { steps { sh 'rm -rf country_vaccination' - sh 'chmod +x mlflow_model.py' - sh 'python3 mlflow_model.py' + sh 'chmod +x pred_from_model.py' + sh 'python3 pred_from_model.py' + } + } + stage('archiveArtifacts') { + steps{ + archiveArtifacts 'movies_imdb/**' } } stage('sendMail') { diff --git a/Jenkisfile_train b/Jenkisfile_train index 1fde225..23edda3 100644 --- a/Jenkisfile_train +++ b/Jenkisfile_train @@ -15,8 +15,8 @@ pipeline { } stage('training') { steps { - //sh 'chmod +x tensor.py' - //sh 'python3 tensor.py' + sh 'chmod +x tensor.py' + sh 'python3 tensor.py' sh 'rm -rf country_vaccination' sh 'chmod +x mlflow_model.py' sh 'python3 mlflow_model.py' diff --git a/pred_from_model.py b/pred_from_model.py new file mode 100644 index 0000000..7d2acb7 --- /dev/null +++ b/pred_from_model.py @@ -0,0 +1,13 @@ +import json +import mlflow as mlf +import pandas as pd + +model = mlf.keras.load_model("country_vaccination") + + +with open('movies_imdb/input_example.json', 'r') as datafile: + data = json.load(datafile).inputs + +input_dictionary = {idx:x for idx, x in enumerate(data)} +input_ex = pd.DataFrame([input_dictionary]) +print(model.predict(input_ex)) \ No newline at end of file