MLmodel file
This commit is contained in:
parent
5f107e11fb
commit
ace49e0c42
@ -33,6 +33,7 @@ pipeline {
|
|||||||
img.inside {
|
img.inside {
|
||||||
sh 'chmod +x dlgssdpytorch.py'
|
sh 'chmod +x dlgssdpytorch.py'
|
||||||
sh 'python3 ./dlgssdpytorch.py $PARAMETRY'
|
sh 'python3 ./dlgssdpytorch.py $PARAMETRY'
|
||||||
|
sh 'rm -rf my_model'
|
||||||
sh 'chmod +x train_mlflow.py'
|
sh 'chmod +x train_mlflow.py'
|
||||||
//sh 'chmod +x generate_MLmodel.py'
|
//sh 'chmod +x generate_MLmodel.py'
|
||||||
//sh 'python3 ./generate_MLmodel.py'
|
//sh 'python3 ./generate_MLmodel.py'
|
||||||
@ -46,7 +47,7 @@ pipeline {
|
|||||||
stage('end') {
|
stage('end') {
|
||||||
steps {
|
steps {
|
||||||
//Zarchiwizuj wynik
|
//Zarchiwizuj wynik
|
||||||
archiveArtifacts 'model.pt, my_runs/**/*'
|
archiveArtifacts 'model.pt, my_runs/**/*, my_model/**/*'
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ import mlflow.pytorch
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from mlflow.models.signature import infer_signature
|
from mlflow.models.signature import infer_signature
|
||||||
|
|
||||||
|
|
||||||
class LayerLinearRegression(nn.Module):
|
class LayerLinearRegression(nn.Module):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@ -27,6 +26,7 @@ parser.add_argument('-e', '--epochs', type=int, default=100, help="Liczba epok",
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
lr = args.lr
|
lr = args.lr
|
||||||
n_epochs = args.epochs
|
n_epochs = args.epochs
|
||||||
mlflow.set_experiment("s426206")
|
mlflow.set_experiment("s426206")
|
||||||
@ -133,7 +133,9 @@ if __name__ == "__main__":
|
|||||||
tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
|
tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
|
||||||
# print(tracking_url_type_store)
|
# print(tracking_url_type_store)
|
||||||
# Model registry does not work with file store
|
# Model registry does not work with file store
|
||||||
|
|
||||||
if tracking_url_type_store != "file":
|
if tracking_url_type_store != "file":
|
||||||
mlflow.sklearn.log_model(model, "model", registered_model_name="s426206", signature=siganture, input_example=input_example)
|
mlflow.pytorch.log_model(model, "model", registered_model_name="s426206", signature=siganture, input_example=input_example)
|
||||||
else:
|
else:
|
||||||
mlflow.sklearn.log_model(model, "model", signature=siganture, input_example=input_example)
|
mlflow.pytorch.log_model(model, "model", signature=siganture, input_example=input_example)
|
||||||
|
mlflow.pytorch.save_model(model, "my_model", signature=siganture, input_example=input_example)
|
Loading…
Reference in New Issue
Block a user