Commit 57a7951b authored by Your Name's avatar Your Name

Fix cache listing to include HuggingFace subdirectories

- Recursively scan huggingface cache directory (hub/, xet/, etc.)
- Also fix remove-model to search recursively in huggingface cache
parent f606b9a7
...@@ -5262,8 +5262,8 @@ def main(): ...@@ -5262,8 +5262,8 @@ def main():
print(f" No cached files.") print(f" No cached files.")
continue continue
# For diffusers, show directory structure # For diffusers and huggingface, show directory structure
if cache_name == 'diffusers': if cache_name in ('diffusers', 'huggingface'):
for root, dirs, files in os.walk(cache_dir): for root, dirs, files in os.walk(cache_dir):
for f in files: for f in files:
filepath = os.path.join(root, f) filepath = os.path.join(root, f)
...@@ -5351,8 +5351,8 @@ def main(): ...@@ -5351,8 +5351,8 @@ def main():
if not os.path.exists(cache_dir): if not os.path.exists(cache_dir):
continue continue
# For diffusers, search in subdirectories # For diffusers and huggingface, search recursively
if cache_name == 'diffusers': if cache_name in ('diffusers', 'huggingface'):
for root, dirs, files in os.walk(cache_dir): for root, dirs, files in os.walk(cache_dir):
for f in files: for f in files:
if args.remove_model.lower() in f.lower(): if args.remove_model.lower() in f.lower():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment