-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #901 from coqui-ai/dev
v0.4.2
- Loading branch information
Showing
8 changed files
with
104 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: zoo-tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
check_skip: | ||
runs-on: ubuntu-latest | ||
if: "! contains(github.event.head_commit.message, '[ci skip]')" | ||
steps: | ||
- run: echo "${{ github.event.head_commit.message }}" | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
experimental: [false] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }} | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
- name: check OS | ||
run: cat /etc/os-release | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y git make | ||
sudo apt install -y python3-wheel gcc | ||
make system-deps | ||
- name: Upgrade pip | ||
run: python3 -m pip install --upgrade pip | ||
- name: Install TTS | ||
run: | | ||
python3 -m pip install .[all] | ||
python3 setup.py egg_info | ||
- name: Unit tests | ||
run: make test_zoo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.4.1 | ||
0.4.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python3` | ||
import glob | ||
import os | ||
import shutil | ||
|
||
from tests import get_tests_output_path, run_cli | ||
from TTS.tts.utils.speakers import SpeakerManager | ||
from TTS.utils.generic_utils import get_user_data_dir | ||
from TTS.utils.manage import ModelManager | ||
|
||
|
||
def test_run_all_models(): | ||
"""Check if all the models are downloadable and tts models run correctly.""" | ||
print(" > Run synthesizer with all the models.") | ||
download_dir = get_user_data_dir("tts") | ||
output_path = os.path.join(get_tests_output_path(), "output.wav") | ||
manager = ModelManager(output_prefix=get_tests_output_path()) | ||
model_names = manager.list_models() | ||
for model_name in model_names: | ||
model_path, _, _ = manager.download_model(model_name) | ||
if "tts_models" in model_name: | ||
local_download_dir = os.path.dirname(model_path) | ||
# download and run the model | ||
speaker_files = glob.glob(local_download_dir + "/speaker*") | ||
if len(speaker_files) > 0: | ||
# multi-speaker model | ||
if "speaker_ids" in speaker_files[0]: | ||
speaker_manager = SpeakerManager(speaker_id_file_path=speaker_files[0]) | ||
elif "speakers" in speaker_files[0]: | ||
speaker_manager = SpeakerManager(d_vectors_file_path=speaker_files[0]) | ||
speaker_id = list(speaker_manager.speaker_ids.keys())[0] | ||
run_cli( | ||
f"tts --model_name {model_name} " | ||
f'--text "This is an example." --out_path "{output_path}" --speaker_idx "{speaker_id}"' | ||
) | ||
else: | ||
# single-speaker model | ||
run_cli(f"tts --model_name {model_name} " f'--text "This is an example." --out_path "{output_path}"') | ||
# remove downloaded models | ||
shutil.rmtree(download_dir) | ||
else: | ||
# only download the model | ||
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) |