Skip to content

Commit 789ddd2

Browse files
authored
Update config_utils.py
1 parent 781fd34 commit 789ddd2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

deepspeed/runtime/config_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ def iterencode(self, o, _one_shot=False, level=0):
3131
return f"{o:e}"
3232
else:
3333
return f"{o}"
34-
elif isinstance(o, collections.Mapping):
34+
elif isinstance(o, collections.abc.Mapping):
3535
x = [
3636
f'\n{prefix}"{k}": {self.iterencode(v, level=level)}' for k,
3737
v in o.items()
3838
]
3939
return "{" + ', '.join(x) + f"\n{prefix_close}" + "}"
40-
elif isinstance(o, collections.Sequence) and not isinstance(o, str):
40+
elif isinstance(o, collections.abc.Sequence) and not isinstance(o, str):
4141
return f"[{ f', '.join(map(self.iterencode, o)) }]"
4242
return "\n, ".join(super().iterencode(o, _one_shot))
4343

@@ -74,3 +74,4 @@ def dict_raise_error_on_duplicate_keys(ordered_pairs):
7474
keys = [key for key, value in counter.items() if value > 1]
7575
raise ValueError("Duplicate keys in DeepSpeed config: {}".format(keys))
7676
return d
77+

0 commit comments

Comments
 (0)