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

fugashi (pulled in by misaki[ja]) needs a MeCab dictionary at runtime.
The `unidic` package that ships today contains no data — it relies on
`python -m unidic download` (~526MB), which isn't run by `just setup`
and won't survive PyInstaller freezing.

Switch to `unidic-lite`, which bundles a MeCab-compatible dict inside
the wheel (~50MB). Collect its data files in build_binary.py so frozen
builds also pick up the dicdir. Same failure mode and same fix shape as
the existing en_core_web_sm pre-install.
This commit is contained in:
Jamie Pine
2026-04-20 17:48:44 -07:00
parent 0f97300b4d
commit f473c00397
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -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",
]
+5
View File
@@ -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