fixed pretrains list

This commit is contained in:
SayanoAI
2024-09-10 11:58:28 -04:00
parent 91e552f756
commit ec21a76e84
3 changed files with 26 additions and 16 deletions
+2 -2
View File
@@ -41,11 +41,11 @@ def get_subprocesses(pid = os.getpid()):
})
yield process
def get_filenames(root=CWD,folder="**",exts=["*"],name_filters=[""],filter_func=any,format_func=lambda x:x):
def get_filenames(root=CWD,folder="**",exts=["*"],name_filters=[""],filter_func=bool,format_func=lambda x:x):
fnames = []
for ext in exts:
fnames.extend(glob.glob(f"{root}/{folder}/*.{ext}",recursive=True))
return sorted([format_func(ele) for ele in fnames if filter_func([nf.lower() in ele.lower() for nf in name_filters])])
return sorted([format_func(ele) for ele in fnames if any([nf.lower() in ele.lower() for nf in name_filters]) and filter_func(ele)])
def get_index(arr,value):
if arr is not None: