{"record":{"id":"f1b83ddcf7b911d3","repo":"mudler/LocalAI","slug":"moss-tts-cpp-error-tokenizer-path-is-required-n","errorCode":null,"errorMessage":"[moss-tts-cpp] ERROR: tokenizer_path is required\\n","messagePattern":"\\[moss-tts-cpp\\] ERROR: tokenizer_path is required\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/go/moss-tts-cpp/cpp/mossttscpp.cpp","lineNumber":43,"sourceCode":"    fprintf(stderr, \"[%-5s] %s\", lvl, log);\n    fflush(stderr);\n}\n\nint mtl_load(const char *local_path, const char *codec_path,\n             const char *tokenizer_path) {\n    ggml_log_set(ggml_log_cb, nullptr);\n    ggml_backend_load_all();\n\n    if (!local_path || local_path[0] == '\\0') {\n        fprintf(stderr, \"[moss-tts-cpp] ERROR: local_path is required\\n\");\n        return 1;\n    }\n    if (!codec_path || codec_path[0] == '\\0') {\n        fprintf(stderr, \"[moss-tts-cpp] ERROR: codec_path is required\\n\");\n        return 2;\n    }\n    if (!tokenizer_path || tokenizer_path[0] == '\\0') {\n        fprintf(stderr, \"[moss-tts-cpp] ERROR: tokenizer_path is required\\n\");\n        return 3;\n    }\n\n    fprintf(stderr,\n            \"[moss-tts-cpp] Loading local=%s codec=%s tokenizer=%s\\n\",\n            local_path, codec_path, tokenizer_path);\n\n    g_local = moss_local_load(local_path, codec_path, tokenizer_path);\n    if (!g_local) {\n        fprintf(stderr, \"[moss-tts-cpp] FATAL: moss_local_load failed\\n\");\n        return 4;\n    }\n    fprintf(stderr, \"[moss-tts-cpp] Model loaded (%s)\\n\", moss_tts_version());\n    return 0;\n}\n\nfloat *mtl_tts(const char *text, const char *reference_wav, int seed,\n               int *out_n, int *out_sr) {","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/moss-tts-cpp/cpp/mossttscpp.cpp#L25-L61","documentation":"mtl_load() rejects the call because tokenizer_path is NULL or empty (return 3), after local_path and codec_path passed. Moss TTS needs a tokenizer file as its third mandatory artifact; without it the load is refused before moss_local_load runs.","triggerScenarios":"Calling mtl_load(model, codec, \"\") — tokenizer file missing from the call. Any config that supplies only model and codec hits this.","commonSituations":"Tokenizer artifact not included in the gallery entry; user-supplied config forgets the third path.","solutions":["Provide the tokenizer file path as the third argument.","Add a Go-side pre-check that all three paths are non-empty and the files exist."],"exampleFix":"// before\nrc := C.mtl_load(m, c, C.CString(\"\"));\n// after\nrc := C.mtl_load(m, c, C.CString(cfg.TokenizerPath));","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(tokenizerPath) == \"\" {\n    return errors.New(\"moss-tts-cpp: tokenizer_path is required\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the tokenizer path alongside model and codec in one pre-flight check.","Map return code 3 to a clear 'tokenizer missing' configuration error message."],"tags":["moss-tts-cpp","tts","argument-validation","tokenizer"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}