-
Notifications
You must be signed in to change notification settings - Fork 303
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
Add multidataset #1010
Add multidataset #1010
Conversation
parser.add_argument( | ||
"--perturb-speed", | ||
type=str, | ||
default=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use str2bool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1) | ||
) | ||
if perturb_speed: | ||
cut_set = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a log saying it is doing speed perturb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
||
class MultiDataset: | ||
def __init__(self, manifest_dir: str): | ||
self.manifest_dir = Path(manifest_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document what manifest_dir contains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
filenames = list( | ||
glob.glob( | ||
f"{self.manifest_dir}/multidataset_split_1998/multidataset/multidataset_cuts_train.*.jsonl.gz" | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filenames = list( | |
glob.glob( | |
f"{self.manifest_dir}/multidataset_split_1998/multidataset/multidataset_cuts_train.*.jsonl.gz" | |
) | |
) | |
filenames = glob.glob( | |
f"{self.manifest_dir}/multidataset_split_1998/multidataset/multidataset_cuts_train.*.jsonl.gz" | |
) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
) | ||
|
||
pattern = re.compile(r"multidataset_cuts_train.([0-9]+).jsonl.gz") | ||
idx_filenames = [(int(pattern.search(f).group(1)), f) for f in filenames] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idx_filenames = [(int(pattern.search(f).group(1)), f) for f in filenames] | |
idx_filenames = ((int(pattern.search(f).group(1)), f) for f in filenames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
idx_filenames = [(int(pattern.search(f).group(1)), f) for f in filenames] | ||
idx_filenames = sorted(idx_filenames, key=lambda x: x[0]) | ||
|
||
sorted_filenames = [f[1] for f in idx_filenames] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted_filenames = [f[1] for f in idx_filenames] | |
sorted_filenames = (f[1] for f in idx_filenames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -64,7 +64,7 @@ def get_args(): | |||
parser.add_argument( | |||
"--perturb-speed", | |||
type=str, | |||
default=True, | |||
default=str2bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please refer to multidataset.py for how to use str2bool
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just a mistake by accident...
|
||
logging.info(f"Loading {len(sorted_filenames)} splits") | ||
|
||
return lhotse.combine(lhotse.load_manifest_lazy(p) for p in sorted_filenames) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
lhotse-speech/lhotse#565
We only need to combine splits from the same dataset.
greedy_search
modified_beam_search
fast_beam_search