File size: 465 Bytes
0955f14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
import re

directory = "../chess-mamba-vs-xformer/out/Xformer/50M/"

for filename in os.listdir(directory):
    if filename.endswith(".pt"):
        if filename == "ckpt.pt":
            continue
        
        match = re.search(r'ckpt_(\d+)(?:b|g)', filename)
        if match:
            number = int(match.group(1))
            if number > 33219200:
                file_path = os.path.join(directory, filename)
                os.remove(file_path)