Upload catalog.py with huggingface_hub
Browse files36 unmodified lines373839404041424372 unmodified lines11611711811911912012112236 unmodified lines assert ( artifact_identifier.strip() ), "artifact_identifier should not be an empty string." parts = artifact_identifier.split(constants.catalog_hirarchy_sep) parts = artifact_identifier.split(constants.catalog_hierarchy_sep) parts[-1] = parts[-1] + ".json" return os.path.join(self.location, *parts)
72 unmodified lines
def verify_legal_catalog_name(name): assert re.match( r"^[\w" + constants.catalog_hirarchy_sep + "]+$", name r"^[\w" + constants.catalog_hierarchy_sep + "]+$", name ), f'Artifict name ("{name}") should be alphanumeric. Use "." for nesting (e.g. myfolder.my_artifact)'
catalog.py+2-2