Skip to content

Commit

Permalink
fix(dspy): re-added **kwargs argument in the search function
Browse files Browse the repository at this point in the history
  • Loading branch information
efenocchi committed Jun 18, 2024
1 parent 010d7ba commit f0d4e13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dspy/retrieve/deeplake_rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def embedding_function(self, texts, model="text-embedding-ada-002"):
return [data.embedding for data in openai.embeddings.create(input = texts, model=model).data]

def forward(
self, query_or_queries: Union[str, List[str]], k: Optional[int],
self, query_or_queries: Union[str, List[str]], k: Optional[int],**kwargs
) -> dspy.Prediction:

"""Search with DeepLake for self.k top passages for query
Expand All @@ -102,7 +102,7 @@ def forward(
passages = defaultdict(float)
#deeplake doesn't support batch querying, manually querying each query and storing them
for query in queries:
results = self._deeplake_client.search(query, k=k)
results = self._deeplake_client.search(query, k=k, **kwargs)

for score,text in zip(results.get('score',0.0),results.get('text',"")):
passages[text] += score
Expand Down

0 comments on commit f0d4e13

Please sign in to comment.