Skip to content

LLM inference in C/C++

C++ ggml

misc : read repetition_penalty from generation_config.json (#27659)

Tarek Dakhranb3c3b96a139d
diff --git a/gguf-py/gguf/metadata.py b/gguf-py/gguf/metadata.py
index e954644e28..d5836cc68d 100644
--- a/gguf-py/gguf/metadata.py
+++ b/gguf-py/gguf/metadata.py
@@ -83,7 +83,7 @@ class Metadata:
metadata.sampling_xtc_threshold = gen_config.get("xtc_threshold", metadata.sampling_xtc_threshold)
metadata.sampling_temp = gen_config.get("temperature", metadata.sampling_temp)
metadata.sampling_penalty_last_n = gen_config.get("penalty_last_n", metadata.sampling_penalty_last_n)
- metadata.sampling_penalty_repeat = gen_config.get("penalty_repeat", metadata.sampling_penalty_repeat)
+ metadata.sampling_penalty_repeat = gen_config.get("penalty_repeat", gen_config.get("repetition_penalty", metadata.sampling_penalty_repeat))
metadata.sampling_mirostat = gen_config.get("mirostat", metadata.sampling_mirostat)
metadata.sampling_mirostat_tau = gen_config.get("mirostat_tau", metadata.sampling_mirostat_tau)
metadata.sampling_mirostat_eta = gen_config.get("mirostat_eta", metadata.sampling_mirostat_eta)