diff --git a/vllm/model_executor/layers/sampler.py b/vllm/model_executor/layers/sampler.py index 1d8036310323..93db03add43d 100644 --- a/vllm/model_executor/layers/sampler.py +++ b/vllm/model_executor/layers/sampler.py @@ -158,7 +158,7 @@ def _apply_penalties( continue p = presence_penalties[i] f = frequency_penalties[i] - if p < _SAMPLING_EPS and f < _SAMPLING_EPS: + if abs(p) < _SAMPLING_EPS and abs(f) < _SAMPLING_EPS: continue indices.append(i)