Upload register.py with huggingface_hub
Browse files123426 unmodified lines31323334353637383940414216 unmodified lines596061626364656667686970import copyimport importlibimport inspectimport os26 unmodified linesdef register_local_catalog(catalog_path: str):assert os.path.exists(catalog_path), f"Catalog path {catalog_path} does not exist."assert os.path.isdir(catalog_path), f"Catalog path {catalog_path} is not a directory."_register_catalog(LocalCatalog(location=catalog_path))def _catalogs_list():return list(a for a in Artifactories())def _register_all_catalogs():16 unmodified linesfile_name = os.path.basename(__file__)for file in os.listdir(dir):if file.endswith(".py") and file not in non_registered_files and file != file_name:module_name = file.replace(".py", "")module = importlib.import_module("." + module_name, __package__)for name, obj in inspect.getmembers(module):# Make sure the object is a classif inspect.isclass(obj):# Make sure the class is a subclass of Artifact (but not Artifact itself)12326 unmodified lines303132333435363738394041424316 unmodified lines60616263646566676869707172737475import importlibimport inspectimport os26 unmodified linesdef register_local_catalog(catalog_path: str):assert os.path.exists(catalog_path), f"Catalog path {catalog_path} does not exist."assert os.path.isdir(catalog_path), f"Catalog path {catalog_path} is not a directory."_register_catalog(LocalCatalog(location=catalog_path))def _catalogs_list():return list(Artifactories())def _register_all_catalogs():16 unmodified linesfile_name = os.path.basename(__file__)for file in os.listdir(dir):if (file.endswith(".py")and file not in non_registered_filesand file != file_name):module_name = file.replace(".py", "")module = importlib.import_module("." + module_name, __package__)for _name, obj in inspect.getmembers(module):# Make sure the object is a classif inspect.isclass(obj):# Make sure the class is a subclass of Artifact (but not Artifact itself)
register.py+10-5