From bd2ab95daebe84bae8767c9b489515a94c9371b1 Mon Sep 17 00:00:00 2001 From: dongyong-lee Date: Thu, 31 Aug 2023 00:26:34 +0900 Subject: [PATCH] fix: bug fix when penalties are negative --- 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 6a50ee59ea67a..a99d69e36a21e 100644 --- a/vllm/model_executor/layers/sampler.py +++ b/vllm/model_executor/layers/sampler.py @@ -157,7 +157,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)