From e11222333f43c8466c57d0223380dcf297b02bac Mon Sep 17 00:00:00 2001 From: Dong-Yong Lee Date: Fri, 1 Sep 2023 00:37:17 +0900 Subject: [PATCH] fix: bug fix when penalties are negative (#913) Co-authored-by: dongyong-lee --- vllm/model_executor/layers/sampler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)