Fix CFG with llamacpp_HF

This commit is contained in:
oobabooga 2024-02-19 18:09:40 -08:00
parent 5f7dbf454a
commit c203c57c18

View File

@ -57,7 +57,7 @@ class LlamacppHF(PreTrainedModel):
'n_tokens': self.model.n_tokens, 'n_tokens': self.model.n_tokens,
'input_ids': self.model.input_ids.copy(), 'input_ids': self.model.input_ids.copy(),
'scores': self.model.scores.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): def _validate_model_class(self):