diff --git a/Jenkinsfile_train b/Jenkinsfile_train index bd918cd..45a8605 100644 --- a/Jenkinsfile_train +++ b/Jenkinsfile_train @@ -31,15 +31,14 @@ pipeline { steps { catchError { - sh 'python3.8 Zadanie_06_and_07_training.py ${BATCH_SIZE} ${EPOCHS}' + sh 'python3.8 Zadanie_08_and_09_MLflow.py ${BATCH_SIZE} ${EPOCHS}' } } } stage('Archive artifacts') { steps{ - archiveArtifacts 'wine_model.h5' - archiveArtifacts 'my_runs/**' + archiveArtifacts 'my_model/**' } } } diff --git a/MLproject b/MLproject index e788445..2202e37 100644 --- a/MLproject +++ b/MLproject @@ -8,4 +8,4 @@ entry_points: parameters: batch_size: {type: int, default: 16} epochs: {type: int, default: 15} - command: "python3 Zadanie_08_MLflow.py {batch_size} {epochs}" \ No newline at end of file + command: "python3 Zadanie_08_and_09_MLflow.py {batch_size} {epochs}" \ No newline at end of file diff --git a/Zadanie_08_MLflow.py b/Zadanie_08_and_09_MLflow.py similarity index 94% rename from Zadanie_08_MLflow.py rename to Zadanie_08_and_09_MLflow.py index ce68cab..5128c4a 100644 --- a/Zadanie_08_MLflow.py +++ b/Zadanie_08_and_09_MLflow.py @@ -17,6 +17,7 @@ with mlflow.start_run(): batch_param = int(sys.argv[1]) if len(sys.argv) > 1 else 16 epoch_param = int(sys.argv[2]) if len(sys.argv) > 2 else 15 + mlflow.set_experiment("s434788") mlflow.log_param("batch_size", batch_param) mlflow.log_param("epochs", epoch_param) @@ -69,4 +70,6 @@ with mlflow.start_run(): print(f"accuracy: {results}") - mlflow.log_metric("Accuracy", results) \ No newline at end of file + mlflow.log_metric("Accuracy", results) + + mlflow.keras.save_model(NeuralModel, "my_model") \ No newline at end of file