Add option to enable hardware acceleration for Adapter models #39912
Unanswered
kziovas
asked this question in
Feature Requests
Replies: 1 comment
|
Hi @kziovas - Thanks for opening this one. I'm going to move across as a enhancement/feature request. Thanks again for opening! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
🧩 Feature Request: Add option to enable hardware acceleration for Adapter models
Summary:
Enable users to specify the hardware device (
cuda,cpu,mps,npu, etc.) used for computation when initializing adapter-based models such asTextEmbedding.Current Behavior
Currently, the
TextEmbeddingadapter invecs.adapters.text_embeddinginitializes aSentenceTransformermodel without any control over which device is used for inference:This defaults to automatic device detection inside
sentence-transformers, but users cannot explicitly override it or ensure that hardware acceleration (e.g., GPU or Apple MPS) is utilized when available.Proposed Improvement
Add a new optional argument to the
TextEmbeddingclass:and use it in model initialization:
This aligns with the
SentenceTransformerconstructor signature:Benefits
Example Usage
Backward Compatibility
device=None→ automatic device detection).All reactions