-
Notifications
You must be signed in to change notification settings - Fork 414
egs/vctk/TTS: Add --local-data-dir option to skip VCTK download #2078
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,3 +36,4 @@ node_modules | |
| .DS_Store | ||
| *.fst | ||
| *.arpa | ||
| .venv/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,12 @@ stage=0 | |
| stop_stage=100 | ||
| use_edinburgh_vctk_url=true | ||
|
|
||
| # If you have VCTK already downloaded locally (e.g. from Kaggle), | ||
| # set this to the path of the existing VCTK directory to skip downloading. | ||
| # Example: | ||
| # --local-data-dir /kaggle/input/vctk-corpus | ||
| local_data_dir= | ||
|
|
||
| dl_dir=$PWD/download | ||
|
|
||
| . shared/parse_options.sh || exit 1 | ||
|
|
@@ -44,8 +50,18 @@ if [ $stage -le 0 ] && [ $stop_stage -ge 0 ]; then | |
| # | ||
| # ln -sfv /path/to/VCTK $dl_dir/VCTK | ||
| # | ||
| # Alternatively, use --local-data-dir to point to an existing VCTK directory: | ||
| # | ||
| # bash prepare.sh --local-data-dir /path/to/VCTK | ||
| # | ||
| if [ ! -d $dl_dir/VCTK ]; then | ||
| lhotse download vctk --use-edinburgh-vctk-url ${use_edinburgh_vctk_url} $dl_dir | ||
| if [ -n "$local_data_dir" ]; then | ||
| log "Using local data directory: $local_data_dir" | ||
| mkdir -p $dl_dir | ||
| ln -sfv $local_data_dir $dl_dir/VCTK | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new Useful? React with 👍 / 👎. |
||
| else | ||
| lhotse download vctk --use-edinburgh-vctk-url ${use_edinburgh_vctk_url} $dl_dir | ||
| fi | ||
|
Comment on lines
+58
to
+64
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation of the
References
Comment on lines
+58
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add validation for the local data directory path. The script doesn't verify that 🛡️ Proposed fix to validate the directory exists if [ -n "$local_data_dir" ]; then
+ if [ ! -d "$local_data_dir" ]; then
+ log "Error: local data directory does not exist: $local_data_dir"
+ exit 1
+ fi
log "Using local data directory: $local_data_dir"
- mkdir -p $dl_dir
- ln -sfv $local_data_dir $dl_dir/VCTK
+ mkdir -p "$dl_dir"
+ ln -sfv "$local_data_dir" "$dl_dir/VCTK"
else
- lhotse download vctk --use-edinburgh-vctk-url ${use_edinburgh_vctk_url} $dl_dir
+ lhotse download vctk --use-edinburgh-vctk-url ${use_edinburgh_vctk_url} "$dl_dir"
fi🧰 Tools🪛 Shellcheck (0.11.0)[info] 60-60: Double quote to prevent globbing and word splitting. (SC2086) [info] 61-61: Double quote to prevent globbing and word splitting. (SC2086) [info] 61-61: Double quote to prevent globbing and word splitting. (SC2086) [info] 63-63: Double quote to prevent globbing and word splitting. (SC2086) 🤖 Prompt for AI Agents |
||
| fi | ||
| fi | ||
|
|
||
|
|
||
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.
Can you check that "$local_data_dir" exists?