From 086ac75228af3fea96be58ec45c2f6c17286e75d Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Wed, 3 Jul 2024 19:31:46 -0400 Subject: [PATCH] 3.8 Compatible type annotation (#3938) --- folder_paths.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/folder_paths.py b/folder_paths.py index 2cf45f12..2baf8ce1 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -1,12 +1,13 @@ import os import time import logging +from typing import Set, List, Dict, Tuple -supported_pt_extensions: set[str] = set(['.ckpt', '.pt', '.bin', '.pth', '.safetensors', '.pkl']) +supported_pt_extensions: Set[str] = set(['.ckpt', '.pt', '.bin', '.pth', '.safetensors', '.pkl']) -SupportedFileExtensionsType = set[str] -ScanPathType = list[str] -folder_names_and_paths: dict[str, tuple[ScanPathType, SupportedFileExtensionsType]] = {} +SupportedFileExtensionsType = Set[str] +ScanPathType = List[str] +folder_names_and_paths: Dict[str, Tuple[ScanPathType, SupportedFileExtensionsType]] = {} base_path = os.path.dirname(os.path.realpath(__file__)) models_dir = os.path.join(base_path, "models")