From f02f0338c22f0bc091087ec37f774fe3dc995f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Thu, 29 Apr 2021 09:32:36 +0200 Subject: [PATCH] fix .models.json and add testing to check released models availability --- .github/workflows/main.yml | 1 - TTS/.models.json | 2 +- tests/model_manager.py | 20 ++++++++++++++++++++ tests/test_model_manager.py | 20 -------------------- 4 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 tests/model_manager.py delete mode 100644 tests/test_model_manager.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50295217..9fef1b84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,7 +39,6 @@ jobs: sudo apt install -y python3-wheel gcc make system-deps - name: Upgrade pip - # so we can take advantage of pyproject.toml build-dependency support run: python3 -m pip install --upgrade pip - name: Install TTS run: | diff --git a/TTS/.models.json b/TTS/.models.json index e6e3c1da..5fcfa86b 100644 --- a/TTS/.models.json +++ b/TTS/.models.json @@ -69,7 +69,7 @@ "author": "Eren Gölge @erogol", "license": "", "contact":"egolge@coqui.com" - }, + } } }, "es":{ diff --git a/tests/model_manager.py b/tests/model_manager.py new file mode 100644 index 00000000..4445b091 --- /dev/null +++ b/tests/model_manager.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3` +import os +import shutil +import glob +from tests import get_tests_output_path +from TTS.utils.manage import ModelManager + + +def test_if_all_models_available(): + """Check if all the models are downloadable.""" + print(" > Checking the availability of all the models under the ModelManager.") + manager = ModelManager(output_prefix=get_tests_output_path()) + model_names = manager.list_models() + for model_name in model_names: + manager.download_model(model_name) + print(f" | > OK: {model_name}") + + folders = glob.glob(os.path.join(manager.output_prefix, '*')) + assert len(folders) == len(model_names) + shutil.rmtree(manager.output_prefix) diff --git a/tests/test_model_manager.py b/tests/test_model_manager.py deleted file mode 100644 index e581935b..00000000 --- a/tests/test_model_manager.py +++ /dev/null @@ -1,20 +0,0 @@ -# #!/usr/bin/env python3` -# import os -# import shutil -# import glob -# from tests import get_tests_output_path -# from TTS.utils.manage import ModelManager - - -# def test_if_all_models_available(): -# """Check if all the models are downloadable.""" -# print(" > Checking the availability of all the models under the ModelManager.") -# manager = ModelManager(output_prefix=get_tests_output_path()) -# model_names = manager.list_models() -# for model_name in model_names: -# manager.download_model(model_name) -# print(f" | > OK: {model_name}") - -# folders = glob.glob(os.path.join(manager.output_prefix, '*')) -# assert len(folders) == len(model_names) -# shutil.rmtree(manager.output_prefix)