From 1d6e59c35ea740890cbd76ab36959feb6984ae02 Mon Sep 17 00:00:00 2001 From: Flavio Schneider Date: Tue, 11 Oct 2022 16:12:52 +0200 Subject: [PATCH] fix: remove lambda --- audio_data_pytorch/datasets/audio_web_dataset.py | 6 +++++- setup.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/audio_data_pytorch/datasets/audio_web_dataset.py b/audio_data_pytorch/datasets/audio_web_dataset.py index eba101b..a365391 100644 --- a/audio_data_pytorch/datasets/audio_web_dataset.py +++ b/audio_data_pytorch/datasets/audio_web_dataset.py @@ -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? @@ -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): diff --git a/setup.py b/setup.py index 23df311..4414c0e 100644 --- a/setup.py +++ b/setup.py @@ -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",