Adding model_kwargs for huggingface embedders. (#1450)

This commit is contained in:
Pranav Puranik
2024-06-29 14:37:31 -05:00
committed by GitHub
parent 50c0285cb2
commit 7c24601d0f
6 changed files with 29 additions and 2 deletions

View File

@@ -31,7 +31,8 @@ class HuggingFaceEmbedder(BaseEmbedder):
huggingfacehub_api_token=self.config.api_key or os.getenv("HUGGINGFACE_ACCESS_TOKEN"),
)
else:
embeddings = HuggingFaceEmbeddings(model_name=self.config.model)
embeddings = HuggingFaceEmbeddings(model_name=self.config.model, model_kwargs=self.config.model_kwargs)
embedding_fn = BaseEmbedder._langchain_default_concept(embeddings)
self.set_embedding_fn(embedding_fn=embedding_fn)