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):