mudler/LocalAI · critical

[acestep-cpp] FATAL: failed to load condition encoder\n

Error message

[acestep-cpp] FATAL: failed to load condition encoder\n

What it means

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.

Source

Thrown at backend/go/acestep-cpp/cpp/goacestepcpp.cpp:212

    if (!qwen3_load_text_encoder(&text_enc, g_text_enc_path.c_str())) {
        fprintf(stderr, "[acestep-cpp] FATAL: failed to load text encoder\n");
        return 4;
    }

    int                H_text = text_enc.cfg.hidden_size;  // 1024
    std::vector<float> text_hidden(H_text * S_text);

    qwen3_forward(&text_enc, text_ids.data(), S_text, text_hidden.data());
    fprintf(stderr, "[acestep-cpp] TextEncoder forward done\n");

    // 5. Lyric embedding
    std::vector<float> lyric_embed(H_text * S_lyric);
    qwen3_embed_lookup(&text_enc, lyric_ids.data(), S_lyric, lyric_embed.data());

    // 6. Condition encoder (backend init handled inside cond_ggml_load)
    CondGGML cond = {};
    if (!cond_ggml_load(&cond, g_dit_path.c_str())) {
        fprintf(stderr, "[acestep-cpp] FATAL: failed to load condition encoder\n");
        qwen3_free(&text_enc);
        return 5;
    }

    const int          S_ref = 750;
    std::vector<float> silence_feats(S_ref * 64);
    memcpy(silence_feats.data(), g_silence_full.data(), S_ref * 64 * sizeof(float));

    int                enc_S = 0;
    std::vector<float> enc_hidden;
    cond_ggml_forward(&cond, text_hidden.data(), S_text, lyric_embed.data(), S_lyric,
                      silence_feats.data(), S_ref, enc_hidden, &enc_S);
    fprintf(stderr, "[acestep-cpp] ConditionEncoder done, enc_S=%d\n", enc_S);

    qwen3_free(&text_enc);
    cond_ggml_free(&cond);

    // 7. Build context [T, ctx_ch] = silence[64] + mask[64]

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Verify g_dit_path exists and its size matches the gallery manifest; re-download if truncated.
  2. Check stderr output from cond_ggml_load itself (routed via ggml_log_cb) for the exact tensor or allocation error preceding the FATAL line.
  3. 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.
  4. On low-RAM machines, close other backends first; the text encoder is already resident and both models must fit.
Defensive patterns

Strategy: validation

Validate before calling

if _, err := os.Stat(ditPath); err != nil {
    return fmt.Errorf("DiT/condition encoder missing: %w", err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15). Data as JSON: /api/errors/808b238575cdbb70. Report an issue: GitHub.