Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
  • Loading branch information
zhouzaida and HAOCHENYE committed Mar 28, 2023
1 parent 85e1f59 commit e833a00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mmengine/hooks/checkpoint_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ def __init__(self,

# published keys
if not (isinstance(published_keys, str)
or is_list_of(published_keys, str) or published_keys is None):
or is_seq_of(published_keys, str) or published_keys is None):
raise TypeError(
'"published_keys" should be a str or list of str or None, '
'"published_keys" should be a str or a sequence of str or None, '
f'but got {type(published_keys)}')

if isinstance(published_keys, str):
published_keys = [published_keys]
elif isinstance(published_keys, list):
elif isinstance(published_keys, (list, tuple)):
assert len(published_keys) == len(set(published_keys)), (
'Find duplicate elements in "published_keys".')
self.published_keys = published_keys
Expand Down

0 comments on commit e833a00

Please sign in to comment.