mudler/LocalAI · error

[omnivoice-cpp] ERROR: text is required\n

Error message

[omnivoice-cpp] ERROR: text is required\n

What it means

The omnivoice-cpp backend received a synthesis request with an empty text field. Guard: validate the request text is non-empty before calling into the shim; trim whitespace and reject empty payloads at the gRPC handler so the C++ layer never sees them.

Source

Thrown at backend/go/omnivoice-cpp/cpp/gomnivoicecpp.cpp:92

        if (ref_text && ref_text[0] != '\0')
            tp->ref_text = ref_text;
        tp->denoise = denoise != 0;
    }
    if (seed >= 0)
        tp->mg_seed = (uint64_t)seed;
}

float *omni_tts(const char *text, const char *lang, const char *instruct,
                const float *ref_samples, int ref_n, const char *ref_text,
                long long seed, int denoise, int *out_n) {
    if (out_n)
        *out_n = 0;
    if (!g_ctx) {
        fprintf(stderr, "[omnivoice-cpp] ERROR: model not loaded\n");
        return nullptr;
    }
    if (!text || text[0] == '\0') {
        fprintf(stderr, "[omnivoice-cpp] ERROR: text is required\n");
        return nullptr; // omni_tts: out_n already 0
    }
    ov_tts_params tp;
    fill_params(&tp, text, lang, instruct, ref_samples, ref_n, ref_text, seed,
                denoise);

    ov_audio out = {0};
    enum ov_status rc = ov_synthesize(g_ctx, &tp, &out);
    if (rc != OV_STATUS_OK || out.n_samples <= 0 || !out.samples) {
        fprintf(stderr, "[omnivoice-cpp] ERROR: synthesize failed (rc=%d): %s\n",
                (int)rc, ov_last_error());
        ov_audio_free(&out);
        return nullptr;
    }

    // Copy into a plain malloc buffer the Go side can free symmetrically via
    // omni_pcm_free; then release the ov_audio-owned buffer.
    size_t bytes = (size_t)out.n_samples * sizeof(float);

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Provide a non-empty text field in the TTS request.
  2. Check the client code path to ensure the text parameter is set before calling the synthesize endpoint.

When it happens

Trigger: Thrown at backend/go/omnivoice-cpp/cpp/gomnivoicecpp.cpp:92 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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