File size: 527 Bytes
c66e52a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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")