From a2085b85f04d693222297bf614a5e5b34de04986 Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Tue, 8 Dec 2020 14:04:37 -0500 Subject: [PATCH] Fbsync (#1038) * Import torchaudio #1034 70f429a Summary: Import torchaudio #1027 0cf4b8a Reviewed By: vincentqb, cpuhrsch Differential Revision: D24958707 fbshipit-source-id: d06dd6b59197cc2c16bec5a9012cbf33a172b6b3 * Import torchaudio #1066 4406a6b Summary: Import up to #1066 Reviewed By: cpuhrsch Differential Revision: D25373068 fbshipit-source-id: 890d36a25259b93428b3037c3123ff5a2cacfa04 --- .circleci/build_docs/build_docs.sh | 2 +- .circleci/build_docs/commit_docs.sh | 17 +++++++---------- .circleci/build_docs/install_wheels.sh | 5 ++++- .circleci/regenerate.py | 8 +++++--- torchaudio/datasets/commonvoice.py | 18 +++++++++--------- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.circleci/build_docs/build_docs.sh b/.circleci/build_docs/build_docs.sh index 0ce6c7ce4f..2864a72974 100755 --- a/.circleci/build_docs/build_docs.sh +++ b/.circleci/build_docs/build_docs.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -ex +# shellcheck disable=SC1091 source ./packaging/pkg_helpers.bash export NO_CUDA_PACKAGE=1 setup_env 0.8.0 @@ -10,4 +11,3 @@ pushd docs pip install -r requirements.txt make html popd - diff --git a/.circleci/build_docs/commit_docs.sh b/.circleci/build_docs/commit_docs.sh index f69d15c5ab..9e9548936a 100755 --- a/.circleci/build_docs/commit_docs.sh +++ b/.circleci/build_docs/commit_docs.sh @@ -4,7 +4,7 @@ set -ex if [ "$2" == "" ]; then - echo call as $0 "" "" + echo call as "$0" "" "" echo where src is the built documentation and echo branch should be "master" or "1.7" or so exit 1 @@ -13,24 +13,21 @@ fi src=$1 target=$2 -set -ex echo "committing docs from ${src} to ${target}" git checkout gh-pages -mkdir -p ./$target -rm -rf ./$target/* -cp -r ${src}/build/html/* ./$target -if [ "$target" == "master" ]; then +mkdir -p ./"${target}" +rm -rf ./"${target}"/* +cp -r "${src}/build/html/"* ./"$target" +if [ "${target}" == "master" ]; then mkdir -p ./_static rm -rf ./_static/* - cp -r ${src}/build/html/_static/* ./_static + cp -r "${src}/build/html/_static/"* ./_static git add --all ./_static || true fi -git add --all ./$target || true +git add --all ./"${target}" || true git config user.email "soumith+bot@pytorch.org" git config user.name "pytorchbot" # If there aren't changes, don't make a commit; push is no-op git commit -m "auto-generating sphinx docs" || true git push -u origin gh-pages - - diff --git a/.circleci/build_docs/install_wheels.sh b/.circleci/build_docs/install_wheels.sh index 5ae51732b3..3e15154092 100755 --- a/.circleci/build_docs/install_wheels.sh +++ b/.circleci/build_docs/install_wheels.sh @@ -1,4 +1,8 @@ +#!/usr/bin/env bash + set -ex + +# shellcheck disable=SC1091 source ./packaging/pkg_helpers.bash export NO_CUDA_PACKAGE=1 setup_env 0.8.0 @@ -6,4 +10,3 @@ setup_wheel_python setup_pip_pytorch_version # pytorch is already installed pip install --no-deps ~/workspace/torchaudio* - diff --git a/.circleci/regenerate.py b/.circleci/regenerate.py index 183d405200..ea4639ad86 100755 --- a/.circleci/regenerate.py +++ b/.circleci/regenerate.py @@ -74,23 +74,25 @@ def build_workflow_pair(btype, os_type, python_version, filter_branch, prefix='' return w + def build_doc_job(filter_branch): job = { "name": "build_docs", "python_version": "3.8", - "requires": ["binary_linux_wheel_py3.8",], + "requires": ["binary_linux_wheel_py3.8", ], } if filter_branch: job["filters"] = gen_filter_branch_tree(filter_branch) return [{"build_docs": job}] + def upload_doc_job(filter_branch): job = { "name": "upload_docs", "context": "org-member", "python_version": "3.8", - "requires": ["build_docs",], + "requires": ["build_docs", ], } if filter_branch: @@ -184,7 +186,7 @@ def unittest_workflows(indentation=6): if i == 0 and os_type == "linux" and device_type == "cpu": jobs.append({ - f"stylecheck": { + "stylecheck": { "name": f"stylecheck_py{python_version}", "python_version": python_version, } diff --git a/torchaudio/datasets/commonvoice.py b/torchaudio/datasets/commonvoice.py index 5899e3a4ac..1a1f4273a4 100644 --- a/torchaudio/datasets/commonvoice.py +++ b/torchaudio/datasets/commonvoice.py @@ -178,15 +178,15 @@ def __init__(self, url = os.path.join(version, language + ext_archive) else: raise ValueError( - 'Allowed language values are ``"tatar"``, ``"english"``, ``"german"``,' - '``"french"``, ``"welsh"``, ``"breton"``, ``"chuvash"``, ``"turkish"``, ``"kyrgyz"``,' - '``"irish"``, ``"kabyle"``, ``"catalan"``, ``"taiwanese"``, ``"slovenian"``,' - '``"italian"``, ``"dutch"``, ``"hakha chin"``, ``"esperanto"``, ``"estonian"``,' - '``"persian"``, ``"portuguese"``, ``"basque"``, ``"spanish"``, ``"chinese"``,' - '``"mongolian"``, ``"sakha"``, ``"dhivehi"``, ``"kinyarwanda"``, ``"swedish"``,' - '``"russian"``, ``"indonesian"``, ``"arabic"``, ``"tamil"``, ``"interlingua"``,' - '``"latvian"``, ``"japanese"``, ``"votic"``, ``"abkhaz"``, ``"cantonese"`` and' - '``"romansh sursilvan"``.' + 'Allowed language values are "tatar", "english", "german",' + '"french", "welsh", "breton", "chuvash", "turkish", "kyrgyz",' + '"irish", "kabyle", "catalan", "taiwanese", "slovenian",' + '"italian", "dutch", "hakha chin", "esperanto", "estonian",' + '"persian", "portuguese", "basque", "spanish", "chinese",' + '"mongolian", "sakha", "dhivehi", "kinyarwanda", "swedish",' + '"russian", "indonesian", "arabic", "tamil", "interlingua",' + '"latvian", "japanese", "votic", "abkhaz", "cantonese" and' + '"romansh sursilvan".' ) # Get string representation of 'root' in case Path object is passed