feat: add grpc support for the huggingface text embedding inference (TEI) components - #3870
Open
maxdswain wants to merge 3 commits into
Open
feat: add grpc support for the huggingface text embedding inference (TEI) components#3870maxdswain wants to merge 3 commits into
maxdswain wants to merge 3 commits into
Conversation
Contributor
|
Heads-up for maintainers This PR is from a fork and touches integrations whose integration tests require API keys. Affected integrations:
Please run the integration tests locally ( |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
Coverage report (huggingface_api)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Proposed Changes:
Add grpc support through optional grpc extras for the hugging face text embedding inference (TEI). To support this implementation, I generated a grpc client from the latest TEI protobuf. Instructions on how to regenerate the files from the protobuf have been added to the README.
This needed to be done as the existing huggingface hub inference client does not support grpc, and does not intend to.
How did you test it?
Added unit and integration tests. You need to run
docker compose up -dbefore running the integration tests.Notes for the reviewer
The TEI grpc API doesn't have an API where it takes a list of inputs to embed, so instead for the document embedder components, I used the
EmbedStreaminterface. In my testing, this is faster then using multiple streams one after the other and batching requests.I kept grpc client initialisation in the
__init__method to prevent wasted compute/time on everyrunorrun_asynccall.Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.