Spaces:
Running
on
Zero
Running
on
Zero
Update lemas_tts/infer/text_norm/tokenizer.py
Browse files
lemas_tts/infer/text_norm/tokenizer.py
CHANGED
|
@@ -13,6 +13,7 @@
|
|
| 13 |
# See the License for the specific language governing permissions and
|
| 14 |
# limitations under the License.
|
| 15 |
|
|
|
|
| 16 |
import re, logging
|
| 17 |
from dataclasses import asdict, dataclass
|
| 18 |
from typing import Any, Dict, List, Optional, Pattern, Union
|
|
@@ -35,7 +36,10 @@ try:
|
|
| 35 |
import espeakng_loader
|
| 36 |
|
| 37 |
EspeakWrapper.set_library(espeakng_loader.get_library_path())
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
| 39 |
print("[LEMAS-TTS] espeak-ng configured via espeakng_loader")
|
| 40 |
except Exception as e: # ImportError or runtime errors
|
| 41 |
# Fall back to system espeak-ng discovery.
|
|
|
|
| 13 |
# See the License for the specific language governing permissions and
|
| 14 |
# limitations under the License.
|
| 15 |
|
| 16 |
+
import os
|
| 17 |
import re, logging
|
| 18 |
from dataclasses import asdict, dataclass
|
| 19 |
from typing import Any, Dict, List, Optional, Pattern, Union
|
|
|
|
| 36 |
import espeakng_loader
|
| 37 |
|
| 38 |
EspeakWrapper.set_library(espeakng_loader.get_library_path())
|
| 39 |
+
data_path = espeakng_loader.get_data_path()
|
| 40 |
+
# Export data path via environment so underlying espeak-ng uses it.
|
| 41 |
+
os.environ["ESPEAK_DATA_PATH"] = data_path
|
| 42 |
+
os.environ["ESPEAKNG_DATA_PATH"] = data_path
|
| 43 |
print("[LEMAS-TTS] espeak-ng configured via espeakng_loader")
|
| 44 |
except Exception as e: # ImportError or runtime errors
|
| 45 |
# Fall back to system espeak-ng discovery.
|