repetiton_penalty and logits_bias just using logits_processors (#1004)

* refactor of repetition_penalty and logits_bias to use logits_processor

* nits

---------

Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
nathan
2024-09-30 17:49:03 +02:00
committed by GitHub
parent 418d9a5511
commit 0866e23a67
2 changed files with 33 additions and 35 deletions

View File

@@ -46,7 +46,7 @@ class TestGenerate(unittest.TestCase):
"hello",
max_tokens=5,
verbose=False,
logits_processor=logits_processor,
logits_processor=[logits_processor],
)
self.assertEqual(len(all_toks), len(init_toks) + 5)