Dynamic Temperature HF loader support (#5174)

---------

Co-authored-by: oobabooga <112222186+oobabooga@users.noreply.github.com>
This commit is contained in:
kalomaze 2024-01-07 07:36:26 -06:00 committed by GitHub
parent 3eca20c015
commit 48327cc5c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 184 additions and 8 deletions

View file

@ -144,6 +144,9 @@ class LlamacppHF(PreTrainedModel):
self.model.n_tokens = longest_prefix
if len(seq_tensor) - longest_prefix > 0:
self.model.eval(seq[longest_prefix:])
else:
self.model.n_tokens -= 1
self.model.eval([seq[-1]])
if reset:
self.model.reset()