metric / utils.py
Elron's picture
Upload utils.py with huggingface_hub
118aaef
raw
history blame
No virus
246 Bytes
import abc
class 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]