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

Add ipex support to HuggingFaceEmbeddings #29386

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

echarlaix
Copy link
Contributor

@echarlaix echarlaix commented Jan 23, 2025

ONNX and OpenVINO models are available by specifying the backend argument (the model is loaded using optimum https://github.com/huggingface/optimum)

from langchain_huggingface import HuggingFaceEmbeddings

embedding = HuggingFaceEmbeddings(
    model_name=model_id,
    model_kwargs={"backend": "onnx"},
)

With this PR we also enable the IPEX backend

from langchain_huggingface import HuggingFaceEmbeddings

embedding = HuggingFaceEmbeddings(
    model_name=model_id,
    model_kwargs={"backend": "ipex"},
)

Copy link

vercel bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2025 4:44pm

@echarlaix echarlaix marked this pull request as ready for review January 23, 2025 17:12
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Ɑ: embeddings Related to text embedding models module labels Jan 23, 2025
@echarlaix
Copy link
Contributor Author

@Jofthomas @efriis let me know if that works for you

@efriis
Copy link
Member

efriis commented Jan 23, 2025

@echarlaix any interest in becoming a maintainer of the langchain-huggingface package? That way you could merge+release these as you please, and you'd only make PRs that we'd have to review to update docs!

@echarlaix
Copy link
Contributor Author

@echarlaix any interest in becoming a maintainer of the langchain-huggingface package? That way you could merge+release these as you please, and you'd only make PRs that we'd have to review to update docs!

Thanks a lot for suggesting this @efriis, happy to help on anything related to optimum cc @Jofthomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: embeddings Related to text embedding models module size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants