mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
fix potential crash in autoguess
This commit is contained in:
parent
3fa4843850
commit
d22eca6c47
1 changed files with 9 additions and 5 deletions
|
@ -88,12 +88,12 @@ static gpt_neox_model neox_ctx_v3;
|
|||
|
||||
static mpt_model mpt_ctx_v3;
|
||||
|
||||
static rwkv_v2_context * rwkv_ctx_v2;
|
||||
static rwkv_context * rwkv_ctx_v3;
|
||||
static rwkv_v2_context * rwkv_ctx_v2 = nullptr;
|
||||
static rwkv_context * rwkv_ctx_v3 = nullptr;
|
||||
|
||||
static llama_v2_context * llama_ctx_v2;
|
||||
static llama_v3_context * llama_ctx_v3;
|
||||
static llama_context * llama_ctx_v4;
|
||||
static llama_v2_context * llama_ctx_v2 = nullptr;
|
||||
static llama_v3_context * llama_ctx_v3 = nullptr;
|
||||
static llama_context * llama_ctx_v4 = nullptr;
|
||||
static llama_context * draft_ctx = nullptr; //will remain null if speculative is unused
|
||||
|
||||
static clip_ctx * clp_ctx = nullptr; //for llava
|
||||
|
@ -2659,6 +2659,10 @@ std::string gpttype_get_chat_template()
|
|||
printf("\nWarning: KCPP text generation not initialized!\n");
|
||||
return "";
|
||||
}
|
||||
if(file_format!=FileFormat::GGUF_GENERIC || !llama_ctx_v4)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
// copied from examples/server/utils.hpp::llama_get_chat_template
|
||||
std::string template_key = "tokenizer.chat_template";
|
||||
// call with NULL buffer to get the total size of the string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue