HuggingFaceEmbeddings takes the default model name and reinitializes self.client even while passing in client parameter. #27505
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
No response
Description
The HuggingFaceEmbedding class has a client parameter, which lets you pass in a pre-loaded model. But right now in the code, even after passing the client parameter, it has a DEFAULT_MODEL_NAME = "sentence-transformers/all-mpnet-base-v2" set and it starts downloading a loading that model
The reason for this is i think that
The self.client is initialized without checking if client has been passed into it or not, and regardless creates a new client loading the default model
This can be easily fixed by doing this
Ill be happy to open a pr, fix this small issue then merge. Let me know how to proceed with this.
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: