Commit 07cf6c3f authored by Your Name's avatar Your Name

Fix: --list-cached-models now displays individual cached files

- Added code to print individual cached model files with sizes
- Previously only showed cache directory headers and summary
- Now shows each file with format: [cache_name] filename (size MB)
- Matches the format used by --remove-model command
parent 73c81b2f
...@@ -164,16 +164,21 @@ def main(): ...@@ -164,16 +164,21 @@ def main():
if not all_files: if not all_files:
print("\nNo cached models found.") print("\nNo cached models found.")
sys.exit(0) sys.exit(0)
# Print individual files
for cache_name, filename, size in all_files:
size_mb = size / (1024 * 1024)
print(f" [{cache_name}] {filename} ({size_mb:.1f} MB)")
# Calculate totals # Calculate totals
total_size = sum(size for _, _, size in all_files) total_size = sum(size for _, _, size in all_files)
print(f"\n=== Summary ===") print(f"\n=== Summary ===")
print(f"Total: {len(all_files)} files, {total_size / (1024*1024*1024):.2f} GB") print(f"Total: {len(all_files)} files, {total_size / (1024*1024*1024):.2f} GB")
print("\nCache locations:") print("\nCache locations:")
for cache_name, cache_dir in caches.items(): for cache_name, cache_dir in caches.items():
print(f" {cache_name}: {cache_dir}") print(f" {cache_name}: {cache_dir}")
sys.exit(0) sys.exit(0)
# Handle --remove-all-models # Handle --remove-all-models
......
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