Spaces:
Paused
Paused
Download app/utils/singleton.py from superxu520/G_AI: direct link, hf CLI and curl.
- Browser
- Download file 305 Bytes
-
https://huggingface.co/spaces/superxu520/G_AI/resolve/main/app/utils/singleton.py
- Command line
-
hf download hf://spaces/superxu520/G_AI/app/utils/singleton.py
-
curl -L -o singleton.py https://huggingface.co/spaces/superxu520/G_AI/resolve/main/app/utils/singleton.py
305 Bytes
| from typing import ClassVar, Dict | |
| class Singleton(type): | |
| _instances: ClassVar[Dict[type, object]] = {} | |
| def __call__(cls, *args, **kwargs): | |
| if cls not in cls._instances: | |
| cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) | |
| return cls._instances[cls] | |