Skip to content

Commit

Permalink
fixup: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kylrth committed Jun 1, 2023
1 parent 040404f commit 348b5b6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/datasets/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,9 @@ def create_config_id(
kwargs_in_suffix["data_dir"] = data_dir
if kwargs_in_suffix:
# we don't care about the order of the kwargs
kwargs_in_suffix = {
k: kwargs_in_suffix[k] for k in sorted(kwargs_in_suffix)
}
kwargs_in_suffix = {k: kwargs_in_suffix[k] for k in sorted(kwargs_in_suffix)}
if all(isinstance(v, (str, bool, int, float)) for v in kwargs_in_suffix.values()):
suffix = ",".join(
str(k) + "=" + urllib.parse.quote_plus(str(v)) for k, v in kwargs_in_suffix.items()
)
suffix = ",".join(str(k) + "=" + urllib.parse.quote_plus(str(v)) for k, v in kwargs_in_suffix.items())
if len(suffix) > 32: # hash if too long
suffix = Hasher.hash(kwargs_in_suffix)
else:
Expand Down

0 comments on commit 348b5b6

Please sign in to comment.