Skip to content

Commit

Permalink
feat: introduce a new param for v3 (#40)
Browse files Browse the repository at this point in the history
We also introduce a new parameter for the v3 model. This PR adds that
new param

Signed-off-by: Mohammad Kalim Akram <[email protected]>
  • Loading branch information
makram93 authored Sep 18, 2024
1 parent c19565b commit 27259a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions milvus_model/dense/jinaai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -37,6 +38,7 @@ def __init__(
)
self.task = task
self._dim = dimensions
self.late_chunking = late_chunking

@property
def dim(self):
Expand All @@ -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
Expand Down

0 comments on commit 27259a0

Please sign in to comment.