diff --git a/rag/raptor.py b/rag/raptor.py index 99155e19d..d09ea5719 100644 --- a/rag/raptor.py +++ b/rag/raptor.py @@ -77,11 +77,11 @@ class RecursiveAbstractiveProcessing4TreeOrganizedRetrieval: return optimal_clusters async def __call__(self, chunks, random_state, callback=None): - layers = [(0, len(chunks))] - start, end = 0, len(chunks) if len(chunks) <= 1: return [] chunks = [(s, a) for s, a in chunks if s and len(a) > 0] + layers = [(0, len(chunks))] + start, end = 0, len(chunks) async def summarize(ck_idx: list[int]): nonlocal chunks