diff --git a/llama.cpp b/llama.cpp index b93c1abcd..29caae419 100644 --- a/llama.cpp +++ b/llama.cpp @@ -2801,6 +2801,7 @@ namespace GGUFMeta { case LLAMA_KV_OVERRIDE_TYPE_BOOL: return "bool"; case LLAMA_KV_OVERRIDE_TYPE_INT: return "int"; case LLAMA_KV_OVERRIDE_TYPE_FLOAT: return "float"; + case LLAMA_KV_OVERRIDE_TYPE_STR: return "str"; } return "unknown"; } @@ -2820,6 +2821,9 @@ namespace GGUFMeta { case LLAMA_KV_OVERRIDE_TYPE_FLOAT: { LLAMA_LOG_INFO("%.6f\n", ovrd->float_value); } break; + case LLAMA_KV_OVERRIDE_TYPE_STR: { + LLAMA_LOG_INFO("%s\n", ovrd->str_value); + } break; default: // Shouldn't be possible to end up here, but just in case... throw std::runtime_error( @@ -13698,6 +13702,8 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s gguf_set_val_i32(ctx_out, o.key, o.int_value); } else if (o.tag == LLAMA_KV_OVERRIDE_TYPE_BOOL) { gguf_set_val_bool(ctx_out, o.key, o.bool_value); + } else if (o.tag == LLAMA_KV_OVERRIDE_TYPE_STR) { + gguf_set_val_str(ctx_out, o.key, o.str_value); } else { LLAMA_LOG_WARN("%s: unknown KV override type for key %s\n", __func__, o.key); } diff --git a/llama.h b/llama.h index b5da686f7..894285011 100644 --- a/llama.h +++ b/llama.h @@ -195,6 +195,7 @@ extern "C" { LLAMA_KV_OVERRIDE_TYPE_INT, LLAMA_KV_OVERRIDE_TYPE_FLOAT, LLAMA_KV_OVERRIDE_TYPE_BOOL, + LLAMA_KV_OVERRIDE_TYPE_STR, }; struct llama_model_kv_override { @@ -202,8 +203,9 @@ extern "C" { enum llama_model_kv_override_type tag; union { int64_t int_value; - double float_value; - bool bool_value; + double float_value; + bool bool_value; + char * str_value = nullptr; }; };