Datasets:

ArXiv:
Elron commited on
Commit
523aeee
1 Parent(s): c2f705c

Upload utils.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. utils.py +4 -8
utils.py CHANGED
@@ -1,11 +1,7 @@
1
- import abc
2
 
3
- class Singleton(abc.ABC):
4
  _instances = {}
5
-
6
- def __new__(cls, *args, **kwargs):
7
  if cls not in cls._instances:
8
- cls._instances[cls] = super(Singleton, cls).__new__(cls)
9
- return cls._instances[cls]
10
-
11
-
 
 
1
 
2
+ class Singleton(type):
3
  _instances = {}
4
+ def __call__(cls, *args, **kwargs):
 
5
  if cls not in cls._instances:
6
+ cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
7
+ return cls._instances[cls]