Skip to content

Commit 9cdf2f4

Browse files
committed
fix
1 parent c8e44a7 commit 9cdf2f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llama_cpp/llama.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,11 @@ def min_length_logits_processor(
988988
input_ids: npt.NDArray[np.intc],
989989
scores: npt.NDArray[np.single],
990990
) -> npt.NDArray[np.single]:
991-
# Does it make sense to copy the whole array or can we just overwrite the original one?
992-
new_scores = np.copy(scores)
993991
if len(input_ids) - len(prompt_tokens) < min_tokens:
992+
new_scores = np.copy(scores)
994993
new_scores[self._token_eos] = -np.inf
995-
return new_scores
994+
return new_scores
995+
return scores
996996

997997
_min_length_logits_processor = LogitsProcessorList([min_length_logits_processor])
998998
if logits_processor is None:

0 commit comments

Comments
 (0)