[Bugfix][Frontend] Let pooling requests set padding (#51157)

Signed-off-by: Hert4 <ductransa01@gmail.com>
This commit is contained in:
Hert4
2026-08-27 11:06:20 +00:00
committed by GitHub
parent 42e7942ac9
commit 4a6a3272e8
4 changed files with 70 additions and 12 deletions
@@ -154,7 +154,13 @@ def run_siglip(seed: int):
)
print("Text embedding output:")
outputs = llm.embed(text, use_tqdm=False)
# SigLIP is trained with padding to a fixed length and no attention mask, so
# text embeddings only line up with image embeddings when they are padded.
outputs = llm.embed(
text,
tokenization_kwargs={"padding": "max_length"},
use_tqdm=False,
)
print_embeddings(outputs[0].outputs.embedding)
print("Image embedding output:")