{"record":{"id":"6c2276ef2e9fc1e2","repo":"mudler/LocalAI","slug":"qwen3-tts-cpp-error-model-not-loaded-n","errorCode":null,"errorMessage":"[qwen3-tts-cpp] ERROR: model not loaded\\n","messagePattern":"\\[qwen3-tts-cpp\\] ERROR: model not loaded\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/go/qwen3-tts-cpp/cpp/goqwen3ttscpp.cpp","lineNumber":105,"sourceCode":"    if (top_k > 0)\n        tp->top_k = top_k;\n    if (top_p > 0.0f)\n        tp->top_p = top_p;\n    if (repetition_penalty > 0.0f)\n        tp->repetition_penalty = repetition_penalty;\n    if (max_new_tokens > 0)\n        tp->max_new_tokens = max_new_tokens;\n}\n\nfloat *qt3_tts(const char *text, const char *lang, const char *instruct,\n               const char *speaker, const float *ref_samples, int ref_n,\n               const char *ref_text, long long seed, float temperature,\n               int top_k, float top_p, float repetition_penalty,\n               int max_new_tokens, int *out_n) {\n    if (out_n)\n        *out_n = 0;\n    if (!g_ctx) {\n        fprintf(stderr, \"[qwen3-tts-cpp] ERROR: model not loaded\\n\");\n        return nullptr;\n    }\n    if (!text || text[0] == '\\0') {\n        fprintf(stderr, \"[qwen3-tts-cpp] ERROR: text is required\\n\");\n        return nullptr;\n    }\n    qt_tts_params tp;\n    fill_params(&tp, text, lang, instruct, speaker, ref_samples, ref_n,\n                ref_text, seed, temperature, top_k, top_p, repetition_penalty,\n                max_new_tokens);\n\n    qt_audio out = {0};\n    enum qt_status rc = qt_synthesize(g_ctx, &tp, &out);\n    if (rc != QT_STATUS_OK || out.n_samples <= 0 || !out.samples) {\n        fprintf(stderr, \"[qwen3-tts-cpp] ERROR: synthesize failed (rc=%d): %s\\n\",\n                (int)rc, qt_last_error());\n        qt_audio_free(&out);\n        return nullptr;","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/qwen3-tts-cpp/cpp/goqwen3ttscpp.cpp#L87-L123","documentation":"A synthesis request arrived before the model finished loading. Guard: track loaded state in the backend and reject inference requests with a FailedPrecondition-style error until LoadModel completes.","triggerScenarios":"Thrown at backend/go/qwen3-tts-cpp/cpp/goqwen3ttscpp.cpp:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Load the model first (LoadModel request) before requesting synthesis.","Check earlier logs for a failed model load that left the backend uninitialized."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}