[Bugfix][Frontend] Let pooling requests set padding (#51157)
Signed-off-by: Hert4 <ductransa01@gmail.com>
This commit is contained in:
@@ -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:")
|
||||
|
||||
Reference in New Issue
Block a user