From c203c57c18502a8374dcff2f21bb6048c8afb6a6 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:09:40 -0800 Subject: [PATCH] Fix CFG with llamacpp_HF --- modules/llamacpp_hf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/llamacpp_hf.py b/modules/llamacpp_hf.py index e7e86e0b..e1bdd208 100644 --- a/modules/llamacpp_hf.py +++ b/modules/llamacpp_hf.py @@ -57,7 +57,7 @@ class LlamacppHF(PreTrainedModel): 'n_tokens': self.model.n_tokens, 'input_ids': self.model.input_ids.copy(), 'scores': self.model.scores.copy(), - 'ctx': llama_cpp_lib().llama_new_context_with_model(model.model, model.context_params) + 'ctx': llama_cpp_lib()._internals._LlamaContext(model=model._model, params=model.context_params) } def _validate_model_class(self):