Skip to content

Commit

Permalink
fix: remove lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioschneider committed Oct 11, 2022
1 parent 17b2786 commit 1d6e59c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion audio_data_pytorch/datasets/audio_web_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ def identity(x):
return x


def first(x):
return x[0]


class AudioWebDataset(WebDataset):

# Why batch_size in a dataset constructor?
Expand All @@ -176,7 +180,7 @@ def __init__(
self.shuffle(shuffle)
.decode(torch_audio)
.to_tuple("wav", "json")
.map_tuple((lambda tuple: tuple[0]), identity)
.map_tuple(first, identity)
)

if exists(transforms):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name="audio-data-pytorch",
packages=find_packages(exclude=[]),
version="0.0.14",
version="0.0.15",
license="MIT",
description="Audio Data - PyTorch",
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 1d6e59c

Please sign in to comment.