Add CI tests for notebooks

This commit is contained in:
Josh Meyer 2021-09-15 09:08:12 -04:00
parent 8a3cea8b6d
commit 6405bd1758
2 changed files with 24 additions and 9 deletions

14
ci_scripts/notebook-tests.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -xe
source $(dirname "$0")/all-vars.sh
source $(dirname "$0")/all-utils.sh
set -o pipefail
pip install --upgrade pip setuptools wheel | cat
pip install --upgrade . | cat
set +o pipefail
for python_notebook in ./notebooks/*.ipynb; do
time jupyter nbconvert --to notebook --execute $python_notebook
done

View File

@ -99,11 +99,11 @@
"from coqui_stt_training.util.downloader import maybe_download\n", "from coqui_stt_training.util.downloader import maybe_download\n",
"\n", "\n",
"def download_preformatted_data():\n", "def download_preformatted_data():\n",
" if not os.path.exists(\"sr-data\"):\n", " if not os.path.exists(\"serbian/sr-data\"):\n",
" maybe_download(\"sr-data.tar\", \".\", \"https://coqui-ai-public-data.s3.amazonaws.com/cv/7.0/sr-data.tar\")\n", " maybe_download(\"sr-data.tar\", \"serbian/\", \"https://coqui-ai-public-data.s3.amazonaws.com/cv/7.0/sr-data.tar\")\n",
" print('\\nExtracting data...')\n", " print('\\nExtracting data...')\n",
" tar = tarfile.open(\"sr-data.tar\", mode=\"r:\")\n", " tar = tarfile.open(\"serbian/sr-data.tar\", mode=\"r:\")\n",
" tar.extractall(\".\")\n", " tar.extractall(\"serbian/\")\n",
" tar.close()\n", " tar.close()\n",
" print('\\nFinished extracting data...')\n", " print('\\nFinished extracting data...')\n",
" else:\n", " else:\n",
@ -129,8 +129,8 @@
"id": "fa2aec77" "id": "fa2aec77"
}, },
"source": [ "source": [
"! ls sr-data\n", "! ls serbian/sr-data\n",
"! wc -l sr-data/*.csv" "! wc -l serbian/sr-data/*.csv"
], ],
"id": "fa2aec77", "id": "fa2aec77",
"execution_count": null, "execution_count": null,
@ -161,9 +161,10 @@
"from coqui_stt_training.util.config import initialize_globals_from_args\n", "from coqui_stt_training.util.config import initialize_globals_from_args\n",
"\n", "\n",
"initialize_globals_from_args(\n", "initialize_globals_from_args(\n",
" train_files=[\"sr-data/train.csv\"],\n", " train_files=[\"serbian/sr-data/train.csv\"],\n",
" dev_files=[\"sr-data/dev.csv\"],\n", " dev_files=[\"serbian/sr-data/dev.csv\"],\n",
" test_files=[\"sr-data/test.csv\"],\n", " test_files=[\"serbian/sr-data/test.csv\"],\n",
" checkpoint_dir=\"serbian/checkpoints/\",\n",
" load_train=\"init\",\n", " load_train=\"init\",\n",
" n_hidden=200,\n", " n_hidden=200,\n",
" epochs=1,\n", " epochs=1,\n",