fix: bug fix when penalties are negative (#913)

Co-authored-by: dongyong-lee <dongyong.lee@navercorp.com>
This commit is contained in:
Dong-Yong Lee 2023-09-01 00:37:17 +09:00 committed by GitHub
parent 28873a2799
commit e11222333f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)