-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add run_batch
for standard pipelines
#2595
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good to me already! 👍 The only change I would like to see made is in RetrieverQuestionGenerationPipeline
. Both run
and run_batch
have the same code. So I'd argue that run
should call run_batch
internally instead of duplicating the code. What do you think?
@@ -495,3 +563,21 @@ def run(self, document_ids: List[str], top_k: int = 5): | |||
|
|||
self.document_store.return_embedding = False # type: ignore | |||
return similar_documents | |||
|
|||
def run_batch(self, document_ids: List[str], top_k: int = 5): # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code of run_batch
is exactly the same as for run
here. So I'd say it's better to call run
from within run_batch
and avoid code duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
In #2481, we added the possibility to run batches of queries through a Pipeline. This PR adds makes this possible also for standard pipelines by adding
run_batch
methods.