fix: sample idx off-by-one error for logit_processors (#1179)
* fix sample_idx off-by-one error * self._scores is indexed differently, only modify the index within self._input_ids --------- Co-authored-by: Andrew Lapp <andrew@rew.la> Co-authored-by: Andrei <abetlen@gmail.com>
This commit is contained in:
parent
f7cdf78788
commit
d6be5333e1
1 changed files with 1 additions and 1 deletions
|
@ -557,7 +557,7 @@ class Llama:
|
||||||
logits[:] = (
|
logits[:] = (
|
||||||
logits_processor(self._input_ids, logits)
|
logits_processor(self._input_ids, logits)
|
||||||
if idx is None
|
if idx is None
|
||||||
else logits_processor(self._input_ids[:idx], logits)
|
else logits_processor(self._input_ids[:idx + 1], logits)
|
||||||
)
|
)
|
||||||
|
|
||||||
sampling_params = _LlamaSamplingParams(
|
sampling_params = _LlamaSamplingParams(
|
||||||
|
|
Loading…
Reference in a new issue