File tree Expand file tree Collapse file tree 1 file changed +1
-22
lines changed
src/ragas/testset/transforms Expand file tree Collapse file tree 1 file changed +1
-22
lines changed Original file line number Diff line number Diff line change 33import logging
44import typing as t
55
6- from tqdm .auto import tqdm
7-
8- from ragas .async_utils import apply_nest_asyncio , as_completed , run_async_tasks
6+ from ragas .async_utils import apply_nest_asyncio , run_async_tasks
97from ragas .run_config import RunConfig
108from ragas .testset .graph import KnowledgeGraph
119from ragas .testset .transforms .base import BaseGraphTransformation
@@ -45,25 +43,6 @@ def generate_execution_plan(self, kg: KnowledgeGraph) -> t.Sequence[t.Coroutine]
4543 return coroutines
4644
4745
48- async def run_coroutines (
49- coroutines : t .Sequence [t .Coroutine ], desc : str , max_workers : int
50- ):
51- """
52- Run a sequence of coroutines in parallel.
53- """
54- for future in tqdm (
55- as_completed (coroutines , max_workers = max_workers ),
56- desc = desc ,
57- total = len (coroutines ),
58- # whether you want to keep the progress bar after completion
59- leave = False ,
60- ):
61- try :
62- await future
63- except Exception as e :
64- logger .error (f"unable to apply transformation: { e } " )
65-
66-
6746def get_desc (transform : BaseGraphTransformation | Parallel ):
6847 if isinstance (transform , Parallel ):
6948 transform_names = [t .__class__ .__name__ for t in transform .transformations ]
You can’t perform that action at this time.
0 commit comments