Download src/utils/singleton.py from Akcom/test: direct link, hf CLI and curl.
- Browser
- Download file 240 Bytes
-
https://huggingface.co/spaces/Akcom/test/resolve/main/src/utils/singleton.py
- Command line
-
hf download hf://spaces/Akcom/test/src/utils/singleton.py
-
curl -L -o singleton.py https://huggingface.co/spaces/Akcom/test/resolve/main/src/utils/singleton.py
240 Bytes
| class Singleton(type): | |
| _instances = {} | |
| def __call__(cls, *args, **kwargs): | |
| if cls not in cls._instances: | |
| cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) | |
| return cls._instances[cls] | |