-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix: Update device deserialization for components that use local models #7686
Conversation
Pull Request Test Coverage Report for Build 9065132032Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @sjrl!
Can you explain when this is necessary?
Typically, when serializing a Pipeline containing a SentenceTransformersTextEmbedder
, the used device is serialized and I don't expect it to be null, but maybe I am overlooking something...
(If needed, please also update the LocalWhisperTranscriber
)
Hey @anakin87! And of course. This is more to do with deserializing from a YAML file where the pipeline was only generated as a YAML file (no serialization in this case). It's often the case that in dC we will create a pipeline from a YAML file in an editor that does not have access to the hardware we will run it on. Also it's possible as the editor of the pipeline I don't know what hardware this pipeline will run on (e.g. cpu vs gpu) so it's helpful to be able to specify |
Thanks for the explanation! This PR looks good.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…ls (#7686) * fix: Update device deserializtion for SentenceTransformersTextEmbedder * Add unit test * Fix unit test * Make same change to doc embedder * Add release notes * Add same change to Diversity Ranker and Named Entity Extractor * Add unit test * Add the same for whisper local * Update release notes
Related Issues
Proposed Changes:
I would like to be able to specify
None
ornull
when deserializin a pipeline that uses:SentenceTransfomersTextEmbedder
SentenceTransfomersDocumentEmbedder
NamedEntityExtractor
SentenceTransformersDiversityRanker
Currently I get an error if I try and I'm required to provide a specific device following the
ComponentDevice.to_dict()
format.Following implementation that is used for ExtractiveReader to overcome the same problem.
How did you test it?
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.