diff --git a/open_musiclm/data.py b/open_musiclm/data.py index bd8593f..5db5907 100644 --- a/open_musiclm/data.py +++ b/open_musiclm/data.py @@ -82,9 +82,10 @@ def __init__( files = [] ignore_files = default(ignore_files, []) num_ignored = 0 + ignore_file_set = set([f.split('/')[-1] for f in ignore_files]) for ext in exts: for file in path.glob(f'**/*.{ext}'): - if any(ignore_file in str(file) for ignore_file in ignore_files): + if file.name in ignore_file_set: num_ignored += 1 continue else: