From d58c7d8a0f7d6ddcc75cfae9a49d702b711fa908 Mon Sep 17 00:00:00 2001 From: Piotr Mardziel Date: Wed, 12 Jul 2023 15:21:19 -0700 Subject: [PATCH] min 1 (#288) --- trulens_eval/trulens_eval/utils/langchain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trulens_eval/trulens_eval/utils/langchain.py b/trulens_eval/trulens_eval/utils/langchain.py index 298e5e515..72411f00e 100644 --- a/trulens_eval/trulens_eval/utils/langchain.py +++ b/trulens_eval/trulens_eval/utils/langchain.py @@ -170,7 +170,7 @@ def _get_relevant_documents(self, query: str, *, docs = super()._get_relevant_documents(query, run_manager=run_manager) # Evaluate the filter on each, in parallel. - ex = ThreadPoolExecutor(max_workers=len(docs)) + ex = ThreadPoolExecutor(max_workers=max(1, len(docs))) futures = list( (