Fix: Don't list hidden files as models

Copying files from macOS to Linux would produce files starting with . _ that were incorrectly identified as model files.
This commit is contained in:
tsukumi
2024-09-23 08:22:20 +09:00
parent 245bfe54ae
commit faddb0a8a8
3 changed files with 9 additions and 3 deletions

View File

@@ -45,7 +45,9 @@ if __name__ == "__main__":
model_paths: list[Path] = []
if Path(args.model).is_dir():
for path in Path(args.model).glob("**/*.safetensors"):
model_paths.append(path)
# . から始まるファイルは除外
if not path.name.startswith("."):
model_paths.append(path)
else:
model_paths.append(Path(args.model))