Upload collections.py with huggingface_hub
Browse files- collections.py +3 -0
collections.py
CHANGED
@@ -17,6 +17,9 @@ class ListCollection(Collection):
|
|
17 |
def __getitem__(self, index):
|
18 |
return self.items[index]
|
19 |
|
|
|
|
|
|
|
20 |
|
21 |
class DictCollection(Collection):
|
22 |
items: dict = field(default_factory=dict)
|
|
|
17 |
def __getitem__(self, index):
|
18 |
return self.items[index]
|
19 |
|
20 |
+
def __len__(self):
|
21 |
+
return len(self.items)
|
22 |
+
|
23 |
|
24 |
class DictCollection(Collection):
|
25 |
items: dict = field(default_factory=dict)
|