Zip model

This commit is contained in:
Wojciech Lidwin 2023-05-12 16:00:05 +02:00
parent f650ebbb47
commit a8a75c049e
2 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,7 @@ node {
testImage.inside{
copyArtifacts filter: 'baltimore_train.csv', projectName: 's487197-create-dataset'
sh "python3 ium_sacred.py -epochs $EPOCHS -lr $LR -validation_split $VALIDATION_SPLIT"
archiveArtifacts artifacts: 'baltimore.zip, mlflow_model.pth'
archiveArtifacts artifacts: 'baltimore.zip, mlflow_model.zip'
stage('Buil'){
build job: 's487197-evaluation.eg/master', parameters: [string(name: 'build', value: "${currentBuild.number}")], wait:false
}

View File

@ -77,7 +77,8 @@ def train_model():
mlflow.sklearn.log_model(mlf_model, "model", signature=signature)
hist = pd.DataFrame(history.history)
hist['epoch'] = history.epoch
mlflow.sklearn.save_model(mlf_model, "mlflow_model.pth")
mlflow.sklearn.save_model(mlf_model, "mlflow_model")
shutil.make_archive('mlflow_model', 'zip', 'mlflow_model')
model.save('baltimore_model')
shutil.make_archive('baltimore', 'zip', 'baltimore_model')