Repository navigation
feat(server): load the Kokoro letter-to-sound model from a data wheel in the default bundle - #1068
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Add mini-bart-g2p-snapshot to the default bundle by URL. The wheel holds the unmodified cisco-ai/mini-bart-g2p files (config, tokenizer, model.safetensors, license, model card) at revision 0fbbf8c5, the revision models/hexgrad__Kokoro-82M.yaml pins, and exposes their directory as mini_bart_g2p_snapshot.SNAPSHOT_DIR. It is pure Python data with no dependencies and adds about 16 MB to an installed environment. Recompile the three default bundle locks with uv 0.9.28 and the cutoffs recorded in their manifests (--exclude-newer 2026-10-18T00:00:00Z, --root-exclude-newer 2026-11-06T20:00:00Z). Each lock gains this one package, pinned by sha256 1f24568899c541796c37c10b146994c6682073fd61384507e016fa8907408194; no other package moves. A URL archive carries no upload time, so the cutoffs do not apply to it.
…d snapshot The Kokoro-82M adapter resolved cisco-ai/mini-bart-g2p through the Hub or its cache at load. It now looks in three places, in order: 1. g2p_model names a local directory: use it, as before. 2. The mini_bart_g2p_snapshot package is importable and its REPO_ID and REVISION equal the configured g2p_model and g2p_revision: use its SNAPSHOT_DIR, with no Hub call and no cache lookup. 3. Otherwise resolve the model from the Hub or its cache, as before. A snapshot of another model or revision is never used in place of the configured one. The package is optional: the default bundle installs it from a URL wheel, which the published server distribution cannot declare, so a missing package falls through to step 3. One info line records which source was used. Synthesis is unchanged. Tests cover each step with a fake package in sys.modules, including that the letter-to-sound model is not resolved when the snapshot is used. The README and NOTICE describe the data wheel.
2655cd9 to
aba3ac3
Compare
Stacked on #1066; follow-up to #1063.
What changed
The default bundle installs
mini-bart-g2p-snapshot, a data-only wheel holding the unmodifiedcisco-ai/mini-bart-g2pfiles (config, tokenizer,model.safetensors, license, model card) at the revisionmodels/hexgrad__Kokoro-82M.yamlpins. It is declared by URL indefault.yaml. The three default bundle locks pin it by sha256 and gain only this package (recompiled with uv 0.9.28 and the recorded cutoffs).The Kokoro-82M adapter resolves the letter-to-sound model in this order:
g2p_model;mini_bart_g2p_snapshotpackage, when its repository and revision equal the configuredg2p_modelandg2p_revision;A snapshot of another model or revision is never used. The package is optional, because the published server distribution cannot declare a URL requirement, so a plain
sie-serverinstall keeps the previous behaviour. One info line records the source.README and NOTICE describe the data wheel.
Why
With the default bundle,
load()no longer needs Hub access for the letter-to-sound model. A server without Hub access needs only the Kokoro checkpoint in its cache.The default bundle grows by about 16 MB installed.
How it was tested
mise run lint,mise run typecheckmise run testpython tools/ci/bundle_lock.py check(all targets)test_bundle_image_resolution.pywithSIE_RUN_IMAGE_RESOLUTION=1check_public_tree.pyThe new unit tests use a stubbed package and cover each resolution step: the snapshot is used without a checkpoint lookup; it is ignored when its repository or revision differs, or when another revision is configured; a local directory wins; a missing package or a missing snapshot directory falls back.
Served on one NVIDIA L4 from the recompiled
cuda12-default-amd64lock, with only the Kokoro checkpoint cached andHF_HUB_OFFLINE=1:cisco-ai/mini-bart-g2pappeared in the Hub cache;Limits
g2p_modelorg2p_revisionaway from the pinned values falls back to Hub resolution.Summary by CodeRabbit