From 6c357b3910b8826e281bd1728ae0e68d15fd4e36 Mon Sep 17 00:00:00 2001 From: Dowon Date: Mon, 20 May 2024 00:54:11 +0900 Subject: [PATCH] fix: remove global variable --- adetailer/common.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/adetailer/common.py b/adetailer/common.py index ffc3323..470bb2f 100644 --- a/adetailer/common.py +++ b/adetailer/common.py @@ -13,7 +13,6 @@ from rich import print from torchvision.transforms.functional import to_pil_image REPO_ID = "Bingsu/adetailer" -_download_failed = False T = TypeVar("T", int, float) @@ -26,18 +25,12 @@ class PredictOutput(Generic[T]): def hf_download(file: str, repo_id: str = REPO_ID) -> str: - global _download_failed - - if _download_failed: - return "INVALID" - try: path = hf_hub_download(repo_id, file) except Exception: msg = f"[-] ADetailer: Failed to load model {file!r} from huggingface" print(msg) path = "INVALID" - _download_failed = True return path