Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dataset] unify shuf conf #2427

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions wenet/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.

from functools import partial
import sys
from typing import Optional
from wenet.dataset import processor
from wenet.dataset.datapipes import (WenetRawDatasetSource,
Expand Down Expand Up @@ -42,9 +43,13 @@ def Dataset(data_type,
assert data_type in ['raw', 'shard']
# cycle dataset
cycle = conf.get('cycle', 1)
list_shuffle = conf.get('list_shuffle', False)
list_shuffle_size = conf.get('list_shuffle_size', 10000)

# stage1 shuffle: source
list_shuffle = conf.get('list_shuffle', True)
list_shuffle_size = sys.maxsize
if list_shuffle:
list_shuffle_conf = conf.get('list_shuffle_conf', {})
list_shuffle_size = list_shuffle_conf.get('shuffle_size',
list_shuffle_size)
if data_type == 'raw':
dataset = WenetRawDatasetSource(data_list_file,
partition=partition,
Expand Down
Loading