diff --git a/langfun/core/eval/v2/runners.py b/langfun/core/eval/v2/runners.py index cd9e80c..4ac4362 100644 --- a/langfun/core/eval/v2/runners.py +++ b/langfun/core/eval/v2/runners.py @@ -261,6 +261,9 @@ def run(self) -> None: if cache is not None: self.background_run(cache.save) + # Wait for the background tasks to finish. + self._io_pool.shutdown(wait=True) + @abc.abstractmethod def _run(self, evaluations: list[Evaluation]) -> None: """Runs multiple evaluations."""