Upload catalog.py with huggingface_hub
Browse files- catalog.py +2 -2
catalog.py
CHANGED
@@ -37,7 +37,7 @@ class LocalCatalog(Catalog):
|
|
37 |
assert (
|
38 |
artifact_identifier.strip()
|
39 |
), "artifact_identifier should not be an empty string."
|
40 |
-
parts = artifact_identifier.split(constants.
|
41 |
parts[-1] = parts[-1] + ".json"
|
42 |
return os.path.join(self.location, *parts)
|
43 |
|
@@ -116,7 +116,7 @@ class GithubCatalog(LocalCatalog):
|
|
116 |
|
117 |
def verify_legal_catalog_name(name):
|
118 |
assert re.match(
|
119 |
-
r"^[\w" + constants.
|
120 |
), f'Artifict name ("{name}") should be alphanumeric. Use "." for nesting (e.g. myfolder.my_artifact)'
|
121 |
|
122 |
|
|
|
37 |
assert (
|
38 |
artifact_identifier.strip()
|
39 |
), "artifact_identifier should not be an empty string."
|
40 |
+
parts = artifact_identifier.split(constants.catalog_hierarchy_sep)
|
41 |
parts[-1] = parts[-1] + ".json"
|
42 |
return os.path.join(self.location, *parts)
|
43 |
|
|
|
116 |
|
117 |
def verify_legal_catalog_name(name):
|
118 |
assert re.match(
|
119 |
+
r"^[\w" + constants.catalog_hierarchy_sep + "]+$", name
|
120 |
), f'Artifict name ("{name}") should be alphanumeric. Use "." for nesting (e.g. myfolder.my_artifact)'
|
121 |
|
122 |
|