-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into tts-emilia
- Loading branch information
Showing
7 changed files
with
667 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
from typing import Optional, Sequence, Union | ||
|
||
import click | ||
|
||
from lhotse.bin.modes import download, prepare | ||
from lhotse.recipes.fleurs import download_fleurs, prepare_fleurs | ||
from lhotse.utils import Pathlike | ||
|
||
__all__ = ["fleurs"] | ||
|
||
|
||
@prepare.command(context_settings=dict(show_default=True)) | ||
@click.argument("corpus_dir", type=click.Path(exists=True, dir_okay=True)) | ||
@click.argument("output_dir", type=click.Path()) | ||
@click.option( | ||
"-j", | ||
"--num-jobs", | ||
type=int, | ||
default=1, | ||
help="How many threads to use (can give good speed-ups with slow disks).", | ||
) | ||
@click.option( | ||
"-l", | ||
"--lang", | ||
multiple=True, | ||
default=["all"], | ||
help="Specify which languages to prepare, e.g., " | ||
" lhoste prepare librispeech mtedx_corpus data -l de -l fr -l es ", | ||
) | ||
def fleurs( | ||
corpus_dir: Pathlike, | ||
output_dir: Pathlike, | ||
num_jobs: int, | ||
lang: Optional[Union[str, Sequence[str]]], | ||
): | ||
"""Fleurs ASR data preparation.""" | ||
prepare_fleurs(corpus_dir, output_dir=output_dir, num_jobs=num_jobs, languages=lang) | ||
|
||
|
||
@download.command(context_settings=dict(show_default=True)) | ||
@click.argument("target_dir", type=click.Path()) | ||
@click.option( | ||
"-l", | ||
"--lang", | ||
multiple=True, | ||
default=["all"], | ||
help="Specify which languages to download, e.g., " | ||
" lhotse download fleurs . -l hi_in -l en_us " | ||
" lhotse download fleurs", | ||
) | ||
@click.option( | ||
"--force-download", | ||
type=bool, | ||
is_flag=True, | ||
default=False, | ||
help="Specify whether to overwrite an existing archive", | ||
) | ||
def fleurs( | ||
target_dir: Pathlike, | ||
lang: Optional[Union[str, Sequence[str]]], | ||
force_download: bool = False, | ||
): | ||
"""FLEURS download.""" | ||
download_fleurs( | ||
target_dir, | ||
languages=lang, | ||
force_download=force_download, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from typing import List, Optional, Sequence, Tuple, Union | ||
|
||
import click | ||
|
||
from lhotse.bin.modes import prepare | ||
from lhotse.recipes.radio import prepare_radio | ||
from lhotse.utils import Pathlike | ||
|
||
__all__ = ["radio"] | ||
|
||
|
||
@prepare.command(context_settings=dict(show_default=True)) | ||
@click.argument("corpus_dir", type=click.Path(dir_okay=True)) | ||
@click.argument("output_dir", type=click.Path(dir_okay=True)) | ||
@click.option( | ||
"-d", | ||
"--min-seg-dur", | ||
type=float, | ||
default=0.5, | ||
help="The minimum segment duration", | ||
) | ||
@click.option( | ||
"-j", | ||
"--num-jobs", | ||
type=int, | ||
default=4, | ||
help="The number of parallel threads to use for data preparation", | ||
) | ||
def radio( | ||
corpus_dir: Pathlike, | ||
output_dir: Pathlike, | ||
min_seg_dur: float = 0.5, | ||
num_jobs: int = 4, | ||
): | ||
"""Data preparation""" | ||
prepare_radio( | ||
corpus_dir, | ||
output_dir=output_dir, | ||
num_jobs=num_jobs, | ||
min_segment_duration=min_seg_dur, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.