forked from lhotse-speech/lhotse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds fleurs recipe * Black formatting * Removes useless num_jobs argument in the download cli, and ran isort and black again on *recipes/fleurs.py * Removes what appears to be an unnecessary set_ffmpeg_torchaudio_info call * isort and black fix * Fixes remaining black issues due to trailing space in recipes/__init__.py * Adds FLEURS entry in docs/corpus.rst
- Loading branch information
Showing
5 changed files
with
484 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
Oops, something went wrong.