mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 01:05:09 +02:00
tts cpp model is now loadable in kcpp
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user