Avoid redundant function call in llamacpp_hf
This commit is contained in:
parent
9b7646140c
commit
029da9563f
1 changed files with 3 additions and 2 deletions
|
@ -131,9 +131,10 @@ class LlamacppHF(PreTrainedModel):
|
||||||
longest_prefix = min_length
|
longest_prefix = min_length
|
||||||
|
|
||||||
if longest_prefix > 0:
|
if longest_prefix > 0:
|
||||||
self.model.n_tokens = longest_prefix
|
|
||||||
self.model.eval(seq[longest_prefix:])
|
|
||||||
reset = False
|
reset = False
|
||||||
|
self.model.n_tokens = longest_prefix
|
||||||
|
if len(seq_tensor) - longest_prefix > 0:
|
||||||
|
self.model.eval(seq[longest_prefix:])
|
||||||
|
|
||||||
if reset:
|
if reset:
|
||||||
self.model.reset()
|
self.model.reset()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue