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

feat(transformers): add embeddings with Automodel #1308

Merged
merged 2 commits into from
Nov 20, 2023
Merged

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 <lhc@next-boss.eu>
@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

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
@mudler mudler merged commit 92cbc4d into master Nov 20, 2023
14 checks passed
@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
3 participants