From 8468610c1200a2d994ca6e85b38f20a0ff9dd71f Mon Sep 17 00:00:00 2001 From: hank Date: Thu, 12 Sep 2024 14:54:47 +0800 Subject: [PATCH] add pooling_type for embedding llamacpp --- libs/community/langchain_community/embeddings/llamacpp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/community/langchain_community/embeddings/llamacpp.py b/libs/community/langchain_community/embeddings/llamacpp.py index 49091b5aa6bfb..89d72656ee5eb 100644 --- a/libs/community/langchain_community/embeddings/llamacpp.py +++ b/libs/community/langchain_community/embeddings/llamacpp.py @@ -20,7 +20,7 @@ class LlamaCppEmbeddings(BaseModel, Embeddings): client: Any #: :meta private: model_path: str - + pooling_type:int n_ctx: int = Field(512, alias="n_ctx") """Token context window.""" @@ -79,6 +79,7 @@ def validate_environment(cls, values: Dict) -> Dict: "n_batch", "verbose", "device", + "pooling_type", ] model_params = {k: values[k] for k in model_param_names} # For backwards compatibility, only include if non-null.