This commit is contained in:
brandonrising 2024-03-25 20:59:34 -04:00 committed by Brandon
parent 90f32d17ba
commit 653a8f67a4

View File

@ -649,7 +649,11 @@ class VaeFolderProbe(FolderProbeBase):
class TextualInversionFolderProbe(TextualInversionCheckpointProbe): class TextualInversionFolderProbe(TextualInversionCheckpointProbe):
def __init__(self, model_path: Path): def __init__(self, model_path: Path):
files = os.scandir(model_path) files = os.scandir(model_path)
files = [Path(f.path) for f in files if f.is_file() and f.name.endswith((".ckpt", ".pt", ".pth", ".bin", ".safetensors"))] files = [
Path(f.path)
for f in files
if f.is_file() and f.name.endswith((".ckpt", ".pt", ".pth", ".bin", ".safetensors"))
]
if len(files) != 1: if len(files) != 1:
raise InvalidModelConfigException( raise InvalidModelConfigException(
f"Unable to determine base type for {model_path}: expected exactly one valid model file, found {[f.name for f in files]}." f"Unable to determine base type for {model_path}: expected exactly one valid model file, found {[f.name for f in files]}."