From 27259a07bd52573b62a00d7bd90fe89478279f33 Mon Sep 17 00:00:00 2001 From: Mohammad Kalim Akram Date: Wed, 18 Sep 2024 12:41:54 +0200 Subject: [PATCH] feat: introduce a new param for v3 (#40) We also introduce a new parameter for the v3 model. This PR adds that new param Signed-off-by: Mohammad Kalim Akram --- milvus_model/dense/jinaai.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/milvus_model/dense/jinaai.py b/milvus_model/dense/jinaai.py index 3ca1d65..353d1e6 100644 --- a/milvus_model/dense/jinaai.py +++ b/milvus_model/dense/jinaai.py @@ -16,6 +16,7 @@ def __init__( api_key: Optional[str] = None, task: str = 'retrieval.passage', dimensions: Optional[int] = None, + late_chunking: Optional[bool] = False, **kwargs, ): if api_key is None: @@ -37,6 +38,7 @@ def __init__( ) self.task = task self._dim = dimensions + self.late_chunking = late_chunking @property def dim(self): @@ -58,6 +60,7 @@ def _call_jina_api(self, texts: List[str], task: Optional[str] = None): "input": texts, "model": self.model_name, "task": task, + "late_chunking": self.late_chunking, } if self._dim is not None: data["dimensions"] = self._dim