Skip to content

Commit

Permalink
Allowing downloading Edin. ver. of VCTK (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
JinZr authored Dec 29, 2023
1 parent 2f8ed44 commit 3e53b68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lhotse/bin/modes/recipes/vctk.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def vctk(corpus_dir: Pathlike, output_dir: Pathlike, use_edinburgh_vctk_url: boo

@download.command()
@click.argument("target_dir", type=click.Path())
def vctk(target_dir: Pathlike):
@click.option("--use-edinburgh-vctk-url", default=False)
def vctk(target_dir: Pathlike, use_edinburgh_vctk_url: bool):
"""VCTK download."""
download_vctk(target_dir)
download_vctk(target_dir, use_edinburgh_vctk_url=use_edinburgh_vctk_url)
4 changes: 4 additions & 0 deletions lhotse/recipes/vctk.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
def download_vctk(
target_dir: Pathlike = ".",
force_download: Optional[bool] = False,
use_edinburgh_vctk_url: Optional[bool] = False,
url: Optional[str] = CREST_VCTK_URL,
) -> Path:
"""
Expand All @@ -117,6 +118,9 @@ def download_vctk(
target_dir = Path(target_dir)
target_dir.mkdir(parents=True, exist_ok=True)

if use_edinburgh_vctk_url:
url = EDINBURGH_VCTK_URL

archive_name = url.split("/")[-1]
archive_path = target_dir / archive_name
part_dir = target_dir / archive_name.replace(".zip", "").replace(".tar.gz", "")
Expand Down

0 comments on commit 3e53b68

Please sign in to comment.