mudler/LocalAI · error

[qwen3-tts-cpp] ERROR: text is required\n

Error message

[qwen3-tts-cpp] ERROR: text is required\n

What it means

The qwen3-tts-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.

Source

Thrown at backend/go/qwen3-tts-cpp/cpp/goqwen3ttscpp.cpp:109

    if (repetition_penalty > 0.0f)
        tp->repetition_penalty = repetition_penalty;
    if (max_new_tokens > 0)
        tp->max_new_tokens = max_new_tokens;
}

float *qt3_tts(const char *text, const char *lang, const char *instruct,
               const char *speaker, const float *ref_samples, int ref_n,
               const char *ref_text, long long seed, float temperature,
               int top_k, float top_p, float repetition_penalty,
               int max_new_tokens, int *out_n) {
    if (out_n)
        *out_n = 0;
    if (!g_ctx) {
        fprintf(stderr, "[qwen3-tts-cpp] ERROR: model not loaded\n");
        return nullptr;
    }
    if (!text || text[0] == '\0') {
        fprintf(stderr, "[qwen3-tts-cpp] ERROR: text is required\n");
        return nullptr;
    }
    qt_tts_params tp;
    fill_params(&tp, text, lang, instruct, speaker, ref_samples, ref_n,
                ref_text, seed, temperature, top_k, top_p, repetition_penalty,
                max_new_tokens);

    qt_audio out = {0};
    enum qt_status rc = qt_synthesize(g_ctx, &tp, &out);
    if (rc != QT_STATUS_OK || out.n_samples <= 0 || !out.samples) {
        fprintf(stderr, "[qwen3-tts-cpp] ERROR: synthesize failed (rc=%d): %s\n",
                (int)rc, qt_last_error());
        qt_audio_free(&out);
        return nullptr;
    }

    // Copy into a plain malloc buffer the Go side frees via qt3_pcm_free.
    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. Ensure the client sets the text parameter before calling the endpoint.

When it happens

Trigger: Thrown at backend/go/qwen3-tts-cpp/cpp/goqwen3ttscpp.cpp:109 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/0d3f61daf742bc73. Report an issue: GitHub.