mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-29 07:22:12 +03:00
add __repr__ method for InsertableOrderedDict
This commit is contained in:
@@ -41,6 +41,16 @@ class InsertableOrderedDict(OrderedDict):
|
||||
|
||||
# Return self for method chaining
|
||||
return self
|
||||
|
||||
def __repr__(self):
|
||||
if not self:
|
||||
return "InsertableOrderedDict()"
|
||||
|
||||
items = []
|
||||
for i, (key, value) in enumerate(self.items()):
|
||||
items.append(f"{i}: ({repr(key)}, {repr(value)})")
|
||||
|
||||
return "InsertableOrderedDict([\n " + ",\n ".join(items) + "\n])"
|
||||
|
||||
|
||||
# YiYi TODO:
|
||||
|
||||
Reference in New Issue
Block a user