Skip to content

The open-source AI voice studio. Clone, dictate, create.

fix(backend): bundle unidic-lite for misaki Japanese G2P (#514) (#521)

Jamie Pinef0924d19d3f5
diff --git a/backend/build_binary.py b/backend/build_binary.py
index 875d6733..52bacbfe 100644
--- a/backend/build_binary.py
+++ b/backend/build_binary.py
@@ -287,6 +287,12 @@ def build_server(cuda=False):
"en_core_web_sm",
"--hidden-import",
"en_core_web_sm",
+ # unidic-lite ships the MeCab dictionary used by fugashi (pulled in
+ # by misaki[ja]). The dict lives in unidic_lite/dicdir/ and is
+ # discovered via the package's DICDIR constant, so the data files
+ # must be collected or Japanese Kokoro voices crash at runtime.
+ "--collect-all",
+ "unidic_lite",
"--hidden-import",
"loguru",
]
diff --git a/backend/requirements.txt b/backend/requirements.txt
index b230fe3d..9051645a 100644
--- a/backend/requirements.txt
+++ b/backend/requirements.txt
@@ -46,6 +46,11 @@ misaki[en,ja,zh]>=0.9.4
# spacy model for misaki English G2P — must be pre-installed or misaki
# tries spacy.cli.download() at runtime which crashes frozen builds
en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl
+# fugashi (pulled in by misaki[ja]) needs a MeCab dictionary on disk.
+# unidic-lite ships one inside the wheel (~50MB); the full `unidic` package
+# requires `python -m unidic download` (~526MB) which breaks frozen builds
+# for the same reason en_core_web_sm does.
+unidic-lite>=1.0.8
# Audio processing
librosa>=0.10.0