Skip to content

Commit

Permalink
dump: Fix preproc
Browse files Browse the repository at this point in the history
  • Loading branch information
revsic committed Feb 8, 2022
1 parent 101279f commit a71be6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

2 changes: 1 addition & 1 deletion utils/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a71be6c

Please sign in to comment.