Update server/text_generation_server/utils/logits_process.py

Co-authored-by: OlivierDehaene <olivier@huggingface.co>
This commit is contained in:
drbh 2024-04-22 13:42:15 -04:00
parent d969151a1e
commit c6fafff7f2

View File

@ -114,8 +114,6 @@ class HeterogeneousRepetitionPenaltyLogitsProcessor(LogitsProcessor):
score < 0, score * self.penalty_tensor, score / self.penalty_tensor
)
# set score to 0 where input_ids is a padding token
score *= input_ids.ne(0)
scores.scatter_(1, input_ids, score)
return scores