def log_artifacts(self, local_dir, artifact_path=None): if artifact_path and path_not_unique(artifact_path): raise Exception("Invalid artifact path: '%s'. %s" % (artifact_path, bad_path_message(artifact_path))) artifact_dir = self.get_path_module().join(self.artifact_uri, artifact_path) \ if artifact_path else self.artifact_uri if not self.get_path_module().exists(artifact_dir): mkdir(artifact_dir) dir_util.copy_tree(src=local_dir, dst=artifact_dir)
def log_artifact(self, local_file, artifact_path=None): if artifact_path and path_not_unique(artifact_path): raise Exception("Invalid artifact path: '%s'. %s" % (artifact_path, bad_path_message(artifact_path))) artifact_dir = build_path(self.artifact_uri, artifact_path) \ if artifact_path else self.artifact_uri if not exists(artifact_dir): mkdir(artifact_dir) shutil.copy(local_file, artifact_dir)
def verify_artifact_path(artifact_path): if artifact_path and path_not_unique(artifact_path): raise MlflowException("Invalid artifact path: '%s'. %s" % (artifact_path, bad_path_message(artifact_path)))