{"record":{"id":"808b238575cdbb70","repo":"mudler/LocalAI","slug":"acestep-cpp-fatal-failed-to-load-condition-enco","errorCode":null,"errorMessage":"[acestep-cpp] FATAL: failed to load condition encoder\\n","messagePattern":"\\[acestep-cpp\\] FATAL: failed to load condition encoder\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"backend/go/acestep-cpp/cpp/goacestepcpp.cpp","lineNumber":212,"sourceCode":"    if (!qwen3_load_text_encoder(&text_enc, g_text_enc_path.c_str())) {\n        fprintf(stderr, \"[acestep-cpp] FATAL: failed to load text encoder\\n\");\n        return 4;\n    }\n\n    int                H_text = text_enc.cfg.hidden_size;  // 1024\n    std::vector<float> text_hidden(H_text * S_text);\n\n    qwen3_forward(&text_enc, text_ids.data(), S_text, text_hidden.data());\n    fprintf(stderr, \"[acestep-cpp] TextEncoder forward done\\n\");\n\n    // 5. Lyric embedding\n    std::vector<float> lyric_embed(H_text * S_lyric);\n    qwen3_embed_lookup(&text_enc, lyric_ids.data(), S_lyric, lyric_embed.data());\n\n    // 6. Condition encoder (backend init handled inside cond_ggml_load)\n    CondGGML cond = {};\n    if (!cond_ggml_load(&cond, g_dit_path.c_str())) {\n        fprintf(stderr, \"[acestep-cpp] FATAL: failed to load condition encoder\\n\");\n        qwen3_free(&text_enc);\n        return 5;\n    }\n\n    const int          S_ref = 750;\n    std::vector<float> silence_feats(S_ref * 64);\n    memcpy(silence_feats.data(), g_silence_full.data(), S_ref * 64 * sizeof(float));\n\n    int                enc_S = 0;\n    std::vector<float> enc_hidden;\n    cond_ggml_forward(&cond, text_hidden.data(), S_text, lyric_embed.data(), S_lyric,\n                      silence_feats.data(), S_ref, enc_hidden, &enc_S);\n    fprintf(stderr, \"[acestep-cpp] ConditionEncoder done, enc_S=%d\\n\", enc_S);\n\n    qwen3_free(&text_enc);\n    cond_ggml_free(&cond);\n\n    // 7. Build context [T, ctx_ch] = silence[64] + mask[64]","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/acestep-cpp/cpp/goacestepcpp.cpp#L194-L230","documentation":"Step 6 of the acestep-cpp pipeline failed: cond_ggml_load() could not load the condition encoder from g_dit_path (the DiT model file, which also carries the condition-encoder weights). The shim frees the already-loaded text encoder (qwen3_free) and aborts with exit code 5. Because the condition encoder lives inside the DiT artifact, a failure means the DiT GGUF is missing, corrupt, or lacks the expected condition tensors.","triggerScenarios":"Calling generate when g_dit_path is unset, points to a missing/truncated DiT GGUF, or the GGUF does not contain the condition-encoder tensors that cond_ggml_load looks up. Backend allocation failure inside cond_ggml_load also triggers it.","commonSituations":"DiT model download interrupted (partial GGUF); gallery config maps the condition encoder to a different file than the one shipped; user swapped model files after setting paths; OOM during condition-encoder weight allocation on memory-constrained hosts.","solutions":["Verify g_dit_path exists and its size matches the gallery manifest; re-download if truncated.","Check stderr output from cond_ggml_load itself (routed via ggml_log_cb) for the exact tensor or allocation error preceding the FATAL line.","Confirm the DiT artifact is the one that bundles the condition encoder — a DiT-only file from a different ACEStep release may not carry those tensors.","On low-RAM machines, close other backends first; the text encoder is already resident and both models must fit."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if _, err := os.Stat(ditPath); err != nil {\n    return fmt.Errorf(\"DiT/condition encoder missing: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the DiT artifact bundles condition-encoder tensors (same release as text encoder and VAE).","Treat exit code 5 as a load failure distinct from code 4: text encoder succeeded, DiT did not.","Keep model sets from a single gallery entry to avoid shard mixing."],"tags":["acestep-cpp","model-loading","gguf","condition-encoder","memory"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}