Zaktualizuj 'train-mlflow.py'

This commit is contained in:
Kornelia Girejko 2022-05-15 22:50:41 +02:00
parent a21d7d094e
commit d703a9eec2

View File

@ -104,17 +104,17 @@ def my_main(epochs):
#result = open("output",'w+')
#result.write(f'{y_predicted}')
print(np.array(X_testing[0]))
#input_example = np.array(X_testing[0])
#siganture = mlflow.models.signature.infer_signature(np.array(X_training), np.array(y_predicted_train))
#tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
input_example = np.array(X_testing[0])
siganture = mlflow.models.signature.infer_signature(np.array(X_training), np.array(y_predicted_train))
tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
if tracking_url_type_store != "file":
mlflow.pytorch.log_model(model, "model_new", registered_model_name="478815", signature=siganture,
input_example=input_example)
else:
mlflow.pytorch.log_model(model, "model_new", signature=siganture, input_example=input_example)
#if tracking_url_type_store != "file":
# mlflow.pytorch.log_model(model, "model_new", registered_model_name="478815", signature=siganture,
# input_example=input_example)
#else:
# mlflow.pytorch.log_model(model, "model_new", signature=siganture, input_example=input_example)
#mlflow.pytorch.save_model(model, "model_new", signature=siganture, input_example=input_example)
rmse = mean_squared_error(y_testing, y_predicted)