Fix mlflow
This commit is contained in:
parent
6918c0b7e8
commit
cf74d8cc1c
@ -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'
|
||||
archiveArtifacts artifacts: 'baltimore.zip', 'mlflow_model.pth'
|
||||
stage('Buil'){
|
||||
build job: 's487197-evaluation.eg/master', parameters: [string(name: 'build', value: "${currentBuild.number}")], wait:false
|
||||
}
|
||||
|
@ -72,12 +72,14 @@ def train_model():
|
||||
signature = mlflow.models.signature.infer_signature(train_x, model.predict(x_test))
|
||||
if tracking_url_type_store != "file":
|
||||
|
||||
mlflow.sklearn.log_model(model, "wines-model", registered_model_name="ElasticnetWineModel", signature=signature)
|
||||
mlflow.sklearn.log_model(mlf_model, "baltimore_model", registered_model_name="BaltimoreModel", signature=signature)
|
||||
else:
|
||||
mlflow.sklearn.log_model(model, "model", signature=signature)
|
||||
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")
|
||||
model.save('baltimore_model')
|
||||
|
||||
shutil.make_archive('baltimore', 'zip', 'baltimore_model')
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user