Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions src/ragas/testset/transforms/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import logging
import typing as t

from tqdm.auto import tqdm

from ragas.async_utils import apply_nest_asyncio, as_completed, run_async_tasks
from ragas.async_utils import apply_nest_asyncio, run_async_tasks
from ragas.run_config import RunConfig
from ragas.testset.graph import KnowledgeGraph
from ragas.testset.transforms.base import BaseGraphTransformation
Expand Down Expand Up @@ -45,25 +43,6 @@ def generate_execution_plan(self, kg: KnowledgeGraph) -> t.Sequence[t.Coroutine]
return coroutines


async def run_coroutines(
coroutines: t.Sequence[t.Coroutine], desc: str, max_workers: int
):
"""
Run a sequence of coroutines in parallel.
"""
for future in tqdm(
as_completed(coroutines, max_workers=max_workers),
desc=desc,
total=len(coroutines),
# whether you want to keep the progress bar after completion
leave=False,
):
try:
await future
except Exception as e:
logger.error(f"unable to apply transformation: {e}")


def get_desc(transform: BaseGraphTransformation | Parallel):
if isinstance(transform, Parallel):
transform_names = [t.__class__.__name__ for t in transform.transformations]
Expand Down
Loading