Merge pull request #6 from storytold/echelon-enable-spanish-espeak

Echelon enable spanish espeak
This commit is contained in:
Brandon Thomas
2022-07-27 06:24:04 -04:00
committed by GitHub
4 changed files with 18 additions and 1 deletions
+1
View File
@@ -7,6 +7,7 @@
__pycache__/
tts/models/Wav2Lip/python/
tts/models/tacotron2/python/
tts/python/
secrets.toml
secrets.yaml
target/
+4 -1
View File
@@ -170,10 +170,13 @@ RUN dpkg -i cuda-keyring_1.0-1_all.deb
RUN apt-get update \
&& apt-get install -y \
curl \
python3-pip \
python3 \
python3-pip \
wget
# ESpeak for new text pipeline
RUN apt-get install libespeak-ng1
RUN python3 --version
#RUN python3.7 -m venv python
#RUN . python/bin/activate \
+5
View File
@@ -60,3 +60,8 @@ pycparser==2.20
# For unit tests and static type checking
pyright==0.0.13.post0
pytest==7.0.1
# Text pipeline
num2words==0.5.10
phonemizer==3.2.1
+8
View File
@@ -31,6 +31,7 @@ import magic
import os
from text.pipeline.english_pipeline_v1 import EnglishPipelineV1
from text.pipeline.espeak_pipeline import EspeakPipeline
from text.pipeline.legacy_fakeyou_pipeline import LegacyFakeYouPipeline
from text.pipeline_components.phonetization.cmudict import DEFAULT_CMUDICT_PATH, CMUDict
from text.pipeline_components.phonetization.english_phonetization import EnglishPhonetization
@@ -90,6 +91,11 @@ def load_hifigan_model(checkpoint_path, super_resolution = False):
denoiser = HifiDenoiser(hifigan, mode="normal")
return hifigan, h, denoiser
# Modern pipelines
SPANISH_ESPEAK_PIPELINE = EspeakPipeline(lang='es')
ENGLISH_ESPEAK_PIPELINE = EspeakPipeline(lang='en')
# Legacy pipelines
ENGLISH_PIPELINE_V1 = EnglishPipelineV1(EnglishPhonetization(CMUDict(DEFAULT_CMUDICT_PATH)))
LEGACY_FAKEYOU_PIPELINE = LegacyFakeYouPipeline()
@@ -100,6 +106,8 @@ def preprocess_text(raw_user_text: str, text_pipeline_type: str):
integer_sequence = LEGACY_FAKEYOU_PIPELINE.user_input_to_sequence(raw_user_text)
elif text_pipeline_type == 'english_v1':
integer_sequence = ENGLISH_PIPELINE_V1.user_input_to_sequence(raw_user_text)
elif text_pipeline_type == 'spanish_v2':
integer_sequence = SPANISH_ESPEAK_PIPELINE.user_input_to_sequence(raw_user_text)
else:
# TODO: Fall back to the newest pipeline once server code has been deployed.
integer_sequence = LEGACY_FAKEYOU_PIPELINE.user_input_to_sequence(raw_user_text)