diff --git a/sample.py b/sample.py index a3456e3..a5de567 100644 --- a/sample.py +++ b/sample.py @@ -50,10 +50,13 @@ speechset.utils.mp_dump(acoustic, DUMP_PATH, 4) # load dump -dumped = speechset.utils.DumpDataset( - speechset.AcousticDataset, DUMP_PATH) +class WrappedAcoustic(speechset.utils.IDWrapper): + def __init__(self, *args, **kwargs): + super().__init__(speechset.AcousticDataset(*args, **kwargs)) + +dumped = speechset.utils.DumpDataset(WrappedAcoustic, DUMP_PATH) # unpack -sid, text, mel, textlen, mellen = acoustic[0:3] +sid, text, mel, textlen, mellen = dumped[0:3] print(sid.shape, text.shape, mel.shape, textlen.shape, mellen.shape) diff --git a/utils/dump.py b/utils/dump.py index ba1fa97..0dca4e2 100644 --- a/utils/dump.py +++ b/utils/dump.py @@ -43,7 +43,7 @@ def preprocessor(path: str) -> Any: Returns: loaded. """ - return np.load(path, allow_pickle=True).item() + return np.load(path, allow_pickle=True) return preprocessor