jeff-901 commented on a change in pull request #733:
URL: https://github.com/apache/submarine/pull/733#discussion_r699249673
##########
File path: submarine-sdk/pysubmarine/submarine/models/client.py
##########
@@ -101,6 +107,39 @@ def save_model(self,
else:
raise MlflowException("No valid type of model has been
matched")
+ def save_model_submarine(self,
+ model_type,
+ model,
+ artifact_path,
+ registered_model_name=None):
+ pattern = r"[0-9A-Za-z][0-9A-Za-z-_]*[0-9A-Za-z]|[0-9A-Za-z]"
+ if not re.fullmatch(pattern, artifact_path):
+ raise Exception(
+ "Artifact_path must only contains numbers, characters, hyphen
and underscore. \
+ Artifact_path must starts and ends with numbers or characters.")
+ local_dir = os.path.join(self.root, artifact_path)
+ if os.path.exists(local_dir):
+ version = len(os.listdir(local_dir)) + 1
+ else:
+ version = 1
Review comment:
That sounds good. I will edit it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]