Commit Graph

5 Commits

Author SHA1 Message Date
Claude Owner
6211985730 fix(melo-test): strip standalone Hangul jamo before synthesis
MeloTTS-Korean's symbol vocab only includes precomposed Hangul
syllables. Bare Hangul Compatibility Jamo characters (ㅋㅋㅋ, ㅠㅠ, ㅎㅎ)
and Hangul Jamo block code points blow up in
`cleaned_text_to_sequence` with `KeyError: 'ㅋ'` (or similar).

Pre-clean the request text in `/tts` to drop those code point ranges
before handing the string to the model, collapsing the leftover
whitespace. If sanitization yields an empty string, return 400 with
an explanation instead of a 500 stack trace.

Also document the limitation in the README troubleshooting section.
2026-05-26 21:04:27 +09:00
Claude Owner
106915b55b fix(melo-test): use subscript on spk2id (HParams has no .get)
`model.hps.data.spk2id` is a MeloTTS `HParams` instance, not a dict.
It exposes `__contains__` and `__getitem__` but not `.get()`, so the
previous lookup blew up at lifespan startup with
`AttributeError: 'HParams' object has no attribute 'get'`.

Switch to `spk["KR"] if "KR" in spk else next(iter(spk.values()))`.
2026-05-26 20:49:19 +09:00
Claude Owner
2bed5f38b7 fix(melo-test): unidic download is mandatory, not optional
User got past wheel build, then hit at startup:

  RuntimeError: Failed initializing MeCab
  [ifs] no such file or directory:
      .../site-packages/unidic/dicdir/mecabrc

Root cause: MeloTTS's text/cleaner.py unconditionally imports the
japanese module, which initializes MeCab.Tagger() at module load
time. So even Korean-only use needs the unidic dictionary data,
which is a separate ~250MB download.

- README: add explicit `python -m unidic download` step after
  pip install, and a troubleshooting entry for the mecabrc error.
- Dockerfile: run `python -m unidic download` during image build so
  the container is usable immediately.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 20:45:24 +09:00
Claude Owner
c68de5a232 test(melo): add Dockerfile and document native-build failures
User hit "Failed building wheel for tokenizers / fugashi / mecab-python3"
on first install. Root cause is missing prebuilt wheels (typically
Python 3.12+) and missing MeCab/Rust system tools.

- Dockerfile: python:3.11-slim + MeCab + Rust, one-shot path that
  bypasses host setup entirely.
- README: explicit "Python 3.10/3.11 OR Docker" guidance, per-error
  troubleshooting, OS-specific system-package commands.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 15:44:01 +09:00
Claude Owner
124d9dc99d test: add MeloTTS-Korean browser test harness
melo-test/ contains a minimal FastAPI server + static HTML UI for
auditioning MeloTTS-Korean before wiring it into the bot:

- server.py: POST /tts -> wav, model loaded once at startup
- index.html: textarea + presets + audio player, shows synth latency
- requirements.txt / README.md: setup steps

Directory is melo-test/ because the repo .gitignore already excludes
test/. Discord-bot integration is unchanged in this branch; this is a
local audition harness only.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 15:16:54 +09:00