Spaces:
Running
on
Zero
Running
on
Zero
| import os | |
| def delete_clean_checkpoints(root_dir="models"): | |
| deleted = 0 | |
| for dirpath, _, filenames in os.walk(root_dir): | |
| for fname in filenames: | |
| if fname.endswith("_clean.pth"): | |
| file_path = os.path.join(dirpath, fname) | |
| print(f"🗑️ Deleting: {file_path}") | |
| os.remove(file_path) | |
| deleted += 1 | |
| print(f"\n✅ Deleted {deleted} clean checkpoint(s) from '{root_dir}'") | |
| if __name__ == "__main__": | |
| delete_clean_checkpoints("models") | |