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.
This pull request includes several changes to improve the handling of loading strategies, device placement, and quantization in the
infinity_emb
library. The most important changes involve updates to theSentenceClassifier
,CrossEncoder
, andSentenceTransformer
classes to incorporate new loading strategies and device placements, as well as handling different data types and quantization.Improvements to handling loading strategies and device placement:
libs/infinity_emb/infinity_emb/transformer/classifier/torch.py
: Added support for loading strategies, device placement, and quantization in theSentenceClassifier
class. [1] [2]libs/infinity_emb/infinity_emb/transformer/crossencoder/torch.py
: Updated theCrossEncoder
class to handle loading strategies, device placement, and quantization. [1] [2] [3] [4]libs/infinity_emb/infinity_emb/transformer/embedder/sentence_transformer.py
: Enhanced theSentenceTransformer
class to support loading strategies and device placement.<!--Congratulations! You've made it this far! Thanks for submitting a PR to Infinity!
License & CLA
By submitting this PR, I confirm that my contribution is made under the terms of the MIT license.
-->
Related Issue
Checklist
Additional Notes
Add any other context about the PR here.