[Bugfix] use right truncation for non-generative tasks (#12050)

Signed-off-by: Joe Runde <Joseph.Runde@ibm.com>
This commit is contained in:
Joe Runde
2025-01-15 09:31:01 -07:00
committed by GitHub
parent 57e729e874
commit edce722eaa
3 changed files with 13 additions and 1 deletions

View File

@@ -105,3 +105,10 @@ def test_multiple_pooling_params(llm: LLM):
# pooling_params is None, default params should be applied
outputs = llm.encode(PROMPTS, pooling_params=None)
assert len(PROMPTS) == len(outputs)
@pytest.mark.skip_global_cleanup
def test_right_side_truncation(llm: LLM):
# Embeddings models should truncate the end of the prompt
tokenizer = llm.get_tokenizer()
assert tokenizer.truncation_side == "right"