Upload utils.py with huggingface_hub
Browse files1234567891011import abcclass Singleton(abc.ABC):_instances = {}def __new__(cls, *args, **kwargs):if cls not in cls._instances:cls._instances[cls] = super(Singleton, cls).__new__(cls)return cls._instances[cls]1234567class 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]
utils.py+4-8