Skip to content

Conversation

@mudler
Copy link
Owner

@mudler mudler commented Nov 20, 2023

Description

This PR supersedes #1250 (thanks @l4b4r4b4b4 for the initial work!)

Notes

Notable change: renames huggingface-embeddings to sentencetransformers. However in the container image it is aliased to huggingface-embeddings aliases to sentencentransformers.

Switch SentenceTransformer for AutoModel in order to set trust_remote_code needed to use the encode method with embeddings models like jinai-v2

Signed-off-by: Lucas Hänke de Cansino <[email protected]>
@mudler mudler changed the title Transformers feat(transformers): add embeddings with Automodel Nov 20, 2023
@mudler mudler linked an issue Nov 20, 2023 that may be closed by this pull request
@mudler mudler added the enhancement New feature or request label Nov 20, 2023
@mudler mudler linked an issue Nov 20, 2023 that may be closed by this pull request
@mudler
Copy link
Owner Author

mudler commented Nov 20, 2023

cc @l4b4r4b4b4 @kno10

@mudler mudler merged commit 92cbc4d into master Nov 20, 2023
@mudler mudler deleted the transformers branch November 20, 2023 20:21

import grpc

from transformers import AutoModel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import does not work, because the name transformers is circular.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs some importlib.util workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: support jina-embeddings via sentence-transformers feat(transformer): transformer-based backend

4 participants