3.8 Compatible type annotation

This commit is contained in:
huchenlei 2024-07-03 13:52:24 -04:00
parent 537f35c7bc
commit 78b539c544

View File

@ -1,12 +1,13 @@
import os import os
import time import time
import logging 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] SupportedFileExtensionsType = Set[str]
ScanPathType = list[str] ScanPathType = List[str]
folder_names_and_paths: dict[str, tuple[ScanPathType, SupportedFileExtensionsType]] = {} folder_names_and_paths: Dict[str, Tuple[ScanPathType, SupportedFileExtensionsType]] = {}
base_path = os.path.dirname(os.path.realpath(__file__)) base_path = os.path.dirname(os.path.realpath(__file__))
models_dir = os.path.join(base_path, "models") models_dir = os.path.join(base_path, "models")