From 9a23c43ab4575cecede292380535f165bfe55e3a Mon Sep 17 00:00:00 2001 From: dscripka Date: Thu, 12 Oct 2023 12:01:30 -0400 Subject: [PATCH] Fixed bug when downloading phonemizer model [skip ci] --- openwakeword/data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openwakeword/data.py b/openwakeword/data.py index 964ce77..6e90969 100755 --- a/openwakeword/data.py +++ b/openwakeword/data.py @@ -925,6 +925,8 @@ def generate_adversarial_texts(input_text: str, N: int, include_partial_phrase: # Download phonemizer model for OOV words, if needed if [] in input_text_phones: phonemizer_mdl_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "resources", "en_us_cmudict_forward.pt") + if not os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), "resources")): + os.mkdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), "resources")) if not os.path.exists(phonemizer_mdl_path): logging.warning("Downloading phonemizer model from DeepPhonemizer library...") import requests