Skip to content

Commit 61256c1

Browse files
lalaluneclaude
andcommitted
fix(elizainference): don't let the OmniVoice picker grab the Kokoro GGUF
eliza_find_ggufs() recurses, so eliza_pick_voice_files(bundle/tts) pulled tts/kokoro/kokoro-*.gguf into the OmniVoice candidate list. Sorted alphabetically, "kokoro-*" sorts before "omnivoice-*", so it became tts[0] and was loaded as the OmniVoice LM — ov_init then aborts with "tensor 'llm.embed_tokens.weight' not found". This fires on every tier that bundles both backends (0_8b/2b/4b/9b ship OmniVoice + the fork-Kokoro GGUF). Kokoro has its own dedicated loader (eliza_inference_kokoro_load) with an explicit path argument and must never be auto-picked as the OmniVoice base or codec. Drop any candidate under a kokoro/ subdir from both the tts and codec lists. Device-verified on a Pixel 9a: with both backends staged under tts/, OmniVoice (45120 samples) and Kokoro (39840 samples) now load and synthesize independently. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3f2b969 commit 61256c1

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tools/omnivoice/src/eliza-inference-ffi.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,29 @@ static std::string eliza_lower_ascii(std::string value) {
413413
return value;
414414
}
415415

416+
// Kokoro ships its own GGUF under tts/kokoro/ and is loaded through the
417+
// dedicated eliza_inference_kokoro_load path with an explicit file argument.
418+
// eliza_find_ggufs recurses, so without this filter the OmniVoice picker below
419+
// would pull tts/kokoro/kokoro-*.gguf into its candidate list and (sorting
420+
// before "omnivoice-*") mis-select it as the OmniVoice LM — ov_init then aborts
421+
// with "tensor 'llm.embed_tokens.weight' not found" on every tier that bundles
422+
// both backends (0_8b/2b/4b/9b). Drop any candidate under a kokoro/ subdir.
423+
static void eliza_drop_kokoro_ggufs(std::vector<std::string> & ggufs) {
424+
ggufs.erase(
425+
std::remove_if(ggufs.begin(), ggufs.end(), [](const std::string & p) {
426+
return p.find("/kokoro/") != std::string::npos;
427+
}),
428+
ggufs.end());
429+
}
430+
416431
static bool eliza_pick_voice_files(
417432
const std::filesystem::path & bundle_dir,
418433
std::string & tts_model,
419434
std::string & codec_model) {
420435
std::vector<std::string> tts = eliza_find_ggufs(bundle_dir / "tts");
421436
std::vector<std::string> codec = eliza_find_ggufs(bundle_dir / "codec");
437+
eliza_drop_kokoro_ggufs(tts);
438+
eliza_drop_kokoro_ggufs(codec);
422439
if (tts.empty()) tts = eliza_find_ggufs(bundle_dir / "voice");
423440
if (tts.empty()) return false;
424441
tts_model = tts[0];

0 commit comments

Comments
 (0)