Skip to content

Commit 72e4408

Browse files
committed
llama-quant: use LLM_KV constants instead of hardcoded strings
Remove TODO comments by using the proper LLM_KV_GENERAL_QUANTIZATION_VERSION and LLM_KV_GENERAL_FILE_TYPE constants in llama-quant.cpp. Also remove an obsolete TODO comment in unicode.cpp.
1 parent 5d3a4a7 commit 72e4408

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/llama-quant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,8 @@ static void llama_model_quantize_impl(const std::string & fname_inp, const std::
926926

927927
// copy the KV pairs from the input file
928928
gguf_set_kv (ctx_out.get(), ml.metadata);
929-
gguf_set_val_u32(ctx_out.get(), "general.quantization_version", GGML_QNT_VERSION); // TODO: use LLM_KV
930-
gguf_set_val_u32(ctx_out.get(), "general.file_type", ftype); // TODO: use LLM_KV
929+
gguf_set_val_u32(ctx_out.get(), ml.llm_kv(LLM_KV_GENERAL_QUANTIZATION_VERSION).c_str(), GGML_QNT_VERSION);
930+
gguf_set_val_u32(ctx_out.get(), ml.llm_kv(LLM_KV_GENERAL_FILE_TYPE).c_str(), ftype);
931931

932932
// Remove split metadata
933933
gguf_remove_key(ctx_out.get(), ml.llm_kv(LLM_KV_SPLIT_NO).c_str());

src/unicode.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,6 @@ static std::vector<size_t> unicode_regex_split_custom(const std::string & text,
804804
// tiny_aya digit grouping pattern from tokenizer.json:
805805
// {"type": "Split", "pattern": {"Regex": "\\d{1,3}(?=(?:\\d{3})*\\b)"}, "behavior": "Isolated"}
806806
// Splits digits into groups of 3 from the right (e.g., 1234567 -> 1, 234, 567)
807-
// TODO: Revisit this regex, in case there are any subtle tokenization differences with the original regex.
808807
bpe_offsets = unicode_regex_split_custom_afmoe(text, offsets);
809808
}
810809

0 commit comments

Comments
 (0)