You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File /opt/conda/lib/python3.10/site-packages/dspy/retrieve/retrieve.py:69, in Retrieve.forward(self, query_or_queries, k, by_prob, with_metadata, **kwargs)
67 k = k if k is not None else self.k
68 if not with_metadata:
---> 69 passages = dsp.retrieveEnsemble(queries, k=k, by_prob=by_prob, **kwargs)
70 return Prediction(passages=passages)
71 else:
File /opt/conda/lib/python3.10/site-packages/dsp/primitives/search.py:93, in retrieveEnsemble(queries, k, by_prob, **kwargs)
90 queries = [q for q in queries if q]
92 if len(queries) == 1:
---> 93 return retrieve(queries[0], k, **kwargs)
95 passages = {}
96 for q in queries:
File /opt/conda/lib/python3.10/site-packages/dsp/primitives/search.py:14, in retrieve(query, k, **kwargs)
12 if not dsp.settings.rm:
13 raise AssertionError("No RM is loaded.")
---> 14 passages = dsp.settings.rm(query, k=k, **kwargs)
15 if not isinstance(passages, Iterable):
16 # it's not an iterable yet; make it one.
17 # TODO: we should unify the type signatures of dspy.Retriever
18 passages = [passages]
TypeError: 'list' object is not callable
The text was updated successfully, but these errors were encountered:
retrieve = dspy.Retrieve(k=3)
topK_passages = retrieve(dev_example.product).passages
print(f"Top {retrieve.k} passages for question: {dev_example.product} \n", '-' * 30, '\n')
for idx, passage in enumerate(topK_passages):
print(f'{idx+1}]', passage, '\n')
TypeError Traceback (most recent call last)
Cell In[19], line 3
1 dspy.settings.configure(rm=dataset)
2 retrieve = dspy.Retrieve(k=3)
----> 3 topK_passages = retrieve(dev_example.product).passages
5 print(f"Top {retrieve.k} passages for question: {dev_example.product} \n", '-' * 30, '\n')
7 for idx, passage in enumerate(topK_passages):
File /opt/conda/lib/python3.10/site-packages/dspy/retrieve/retrieve.py:40, in Retrieve.call(self, *args, **kwargs)
39 def call(self, *args, **kwargs):
---> 40 return self.forward(*args, **kwargs)
File /opt/conda/lib/python3.10/site-packages/dspy/retrieve/retrieve.py:69, in Retrieve.forward(self, query_or_queries, k, by_prob, with_metadata, **kwargs)
67 k = k if k is not None else self.k
68 if not with_metadata:
---> 69 passages = dsp.retrieveEnsemble(queries, k=k, by_prob=by_prob, **kwargs)
70 return Prediction(passages=passages)
71 else:
File /opt/conda/lib/python3.10/site-packages/dsp/primitives/search.py:93, in retrieveEnsemble(queries, k, by_prob, **kwargs)
90 queries = [q for q in queries if q]
92 if len(queries) == 1:
---> 93 return retrieve(queries[0], k, **kwargs)
95 passages = {}
96 for q in queries:
File /opt/conda/lib/python3.10/site-packages/dsp/primitives/search.py:14, in retrieve(query, k, **kwargs)
12 if not dsp.settings.rm:
13 raise AssertionError("No RM is loaded.")
---> 14 passages = dsp.settings.rm(query, k=k, **kwargs)
15 if not isinstance(passages, Iterable):
16 # it's not an iterable yet; make it one.
17 # TODO: we should unify the type signatures of dspy.Retriever
18 passages = [passages]
TypeError: 'list' object is not callable
The text was updated successfully, but these errors were encountered: