From 9891888717184570c41f8782a531bcd414cb3ef2 Mon Sep 17 00:00:00 2001 From: Alexander Kurakin Date: Sat, 9 Mar 2024 14:43:40 +0300 Subject: [PATCH] LIBRISPEECH: fix `.get_metadata` type annotation --- src/torchaudio/datasets/librispeech.py | 2 +- src/torchaudio/datasets/librispeech_biasing.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/torchaudio/datasets/librispeech.py b/src/torchaudio/datasets/librispeech.py index 3c53f069a8..7cf05dbecb 100644 --- a/src/torchaudio/datasets/librispeech.py +++ b/src/torchaudio/datasets/librispeech.py @@ -118,7 +118,7 @@ def __init__( self._walker = sorted(str(p.stem) for p in Path(self._path).glob("*/*/*" + self._ext_audio)) - def get_metadata(self, n: int) -> Tuple[Tensor, int, str, int, int, int]: + def get_metadata(self, n: int) -> Tuple[str, int, str, int, int, int]: """Get metadata for the n-th sample from the dataset. Returns filepath instead of waveform, but otherwise returns the same fields as :py:func:`__getitem__`. diff --git a/src/torchaudio/datasets/librispeech_biasing.py b/src/torchaudio/datasets/librispeech_biasing.py index c065f0a24f..bd518cf2b6 100644 --- a/src/torchaudio/datasets/librispeech_biasing.py +++ b/src/torchaudio/datasets/librispeech_biasing.py @@ -129,7 +129,7 @@ def __init__( self._walker = sorted(str(p.stem) for p in Path(self._path).glob("*/*/*" + self._ext_audio)) self.blist = blist - def get_metadata(self, n: int) -> Tuple[Tensor, int, str, int, int, int]: + def get_metadata(self, n: int) -> Tuple[str, int, str, int, int, int]: """Get metadata for the n-th sample from the dataset. Returns filepath instead of waveform, but otherwise returns the same fields as :py:func:`__getitem__`.