Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
unitxt
/
metric
like
0
Running
App
Files
Files
Community
77a9fb3
metric
/
utils.py
Elron
Upload utils.py with huggingface_hub
118aaef
over 1 year ago
raw
Copy download link
history
blame
Safe
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]