Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bhavnicksm opened this issue Jan 22, 2025 · 1 comment

Comments

@bhavnicksm
Copy link

bhavnicksm commented Jan 22, 2025

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! 😊

@bhavnicksm bhavnicksm changed the title convert_to_numpy=True not working with output_as="token_embeddings"; returns torch.Tensor type convert_to_numpy=True not working with output_value="token_embeddings"; returns torch.Tensor type Jan 22, 2025
@bhavnicksm
Copy link
Author

bhavnicksm commented Jan 22, 2025

The issue probably lies at this line

Image

bhavnicksm added a commit to bhavnicksm/sentence-transformers that referenced this issue Jan 22, 2025
bhavnicksm added a commit to bhavnicksm/sentence-transformers that referenced this issue Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant