tts cpp model is now loadable in kcpp

This commit is contained in:
Concedo
2025-08-17 15:47:22 +08:00
parent 9935ac093f
commit 52606e9b1d
14 changed files with 131 additions and 223 deletions
+14
View File
@@ -115,6 +115,20 @@ bool gguf_tensor_exists(const std::string & gguf_filename, std::string tensor_na
return found;
}
std::string gguf_get_model_arch(const std::string & gguf_filename)
{
struct gguf_init_params ggufparams;
ggufparams.no_alloc = true;
ggufparams.ctx = NULL;
struct gguf_context * ctx = gguf_init_from_file(gguf_filename.c_str(), ggufparams);
if (!ctx) return "";
auto keyidx = gguf_find_key(ctx, "general.architecture");
std::string modelarch = "";
if (keyidx != -1) { modelarch = gguf_get_val_str(ctx, keyidx); }
gguf_free(ctx);
return modelarch;
}
//return val: 0=fail, 1=(original ggml, alpaca), 2=(ggmf), 3=(ggjt)
FileFormat check_file_format(const std::string & fname, FileFormatExtraMeta * fileformatmeta)
{