From 9c0d819035219cec93f2e823ff9e811693ba4c19 Mon Sep 17 00:00:00 2001 From: flux9665 Date: Tue, 4 Apr 2023 18:11:28 +0200 Subject: [PATCH] prepare for online demo --- Preprocessing/TextFrontend.py | 3 +-- run_model_downloader.py | 26 +++++++++----------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/Preprocessing/TextFrontend.py b/Preprocessing/TextFrontend.py index f579c2a3..531b3c53 100644 --- a/Preprocessing/TextFrontend.py +++ b/Preprocessing/TextFrontend.py @@ -14,7 +14,6 @@ from Preprocessing.articulatory_features import get_feature_to_index_lookup from Preprocessing.articulatory_features import get_phone_to_id from Preprocessing.french_pos import map_to_wiktionary_pos -from Utility.storage_config import PREPROCESSING_DIR class ArticulatoryCombinedTextFrontend: @@ -115,7 +114,7 @@ def __init__(self, self.g2p_lang = "fr-fr" self.expand_abbreviations = remove_french_spacing # add POS Tagger for Blizzard Challenge - flair.cache_root = Path(f"{PREPROCESSING_DIR}/.flair") + flair.cache_root = Path("./Corpora/.flair") self.pos_tagger = SequenceTagger.load("qanastek/pos-french-camembert-flair") self.homographs = load_json_from_path("Preprocessing/french_homographs_preprocessed.json") self.homograph_list = list(self.homographs.keys()) diff --git a/run_model_downloader.py b/run_model_downloader.py index 580f1e8f..fe21e3dd 100644 --- a/run_model_downloader.py +++ b/run_model_downloader.py @@ -16,19 +16,19 @@ def report(block_number, read_size, total_size): def download_models(): ############# - print("Downloading Aligner Model") - os.makedirs(os.path.join(MODELS_DIR, "Aligner"), exist_ok=True) + print("Downloading ToucanTTS AD Model") + os.makedirs(os.path.join(MODELS_DIR, "ToucanTTS_AD"), exist_ok=True) filename, headers = urllib.request.urlretrieve( - url="https://github.com/DigitalPhonetics/IMS-Toucan/releases/download/v2.4/aligner.pt", - filename=os.path.abspath(os.path.join(MODELS_DIR, "Aligner", "aligner.pt")), + url="https://github.com/DigitalPhonetics/IMS-Toucan/releases/download/v2.b/ad.pt", + filename=os.path.abspath(os.path.join(MODELS_DIR, "ToucanTTS_AD", "best.pt")), reporthook=report) ############# - print("Downloading Multilingual PortaSpeech Model") - os.makedirs(os.path.join(MODELS_DIR, "PortaSpeech_Meta"), exist_ok=True) + print("Downloading ToucanTTS NEB Model") + os.makedirs(os.path.join(MODELS_DIR, "ToucanTTS_NEB"), exist_ok=True) filename, headers = urllib.request.urlretrieve( - url="https://github.com/DigitalPhonetics/IMS-Toucan/releases/download/v2.4/PortaSpeech_Meta.pt", - filename=os.path.abspath(os.path.join(MODELS_DIR, "PortaSpeech_Meta", "best.pt")), + url="https://github.com/DigitalPhonetics/IMS-Toucan/releases/download/v2.b/neb.pt", + filename=os.path.abspath(os.path.join(MODELS_DIR, "ToucanTTS_NEB", "best.pt")), reporthook=report) ############# @@ -43,18 +43,10 @@ def download_models(): print("Downloading Embedding Model") os.makedirs(os.path.join(MODELS_DIR, "Embedding"), exist_ok=True) filename, headers = urllib.request.urlretrieve( - url="https://github.com/DigitalPhonetics/IMS-Toucan/releases/download/v2.4/embedding_function.pt", + url="https://github.com/DigitalPhonetics/IMS-Toucan/releases/download/v2.b/embedding_function.pt", filename=os.path.abspath(os.path.join(MODELS_DIR, "Embedding", "embedding_function.pt")), reporthook=report) - ############# - print("Downloading Embedding GAN") - os.makedirs(os.path.join(MODELS_DIR, "Embedding"), exist_ok=True) - filename, headers = urllib.request.urlretrieve( - url="https://github.com/DigitalPhonetics/IMS-Toucan/releases/download/v2.4/embedding_gan.pt", - filename=os.path.abspath(os.path.join(MODELS_DIR, "Embedding", "embedding_gan.pt")), - reporthook=report) - if __name__ == '__main__': download_models()