Skip to content

convert_to_numpy=True not working with output_value="token_embeddings"; returns torch.Tensor type #3185

@bhavnicksm

Description

@bhavnicksm

Hey ST Team! 👋

I was trying to get the "token_embeddings" from a bge-base-en-v1.5 model, and converting it to numpy.ndarray but it was not functioning as expected.

Have a look at the screenshot below 👇

Image

As a workaround, I was using .cpu().numpy() which was working.

Env:

sentence-transformers              3.3.1

Thanks! 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions