mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix errors detected by Ruff (#3918)
### What problem does this PR solve? Fix errors detected by Ruff ### Type of change - [x] Refactoring
This commit is contained in:
@ -47,7 +47,8 @@ class RecursiveAbstractiveProcessing4TreeOrganizedRetrieval:
|
||||
def __call__(self, chunks, random_state, callback=None):
|
||||
layers = [(0, len(chunks))]
|
||||
start, end = 0, len(chunks)
|
||||
if len(chunks) <= 1: return
|
||||
if len(chunks) <= 1:
|
||||
return
|
||||
chunks = [(s, a) for s, a in chunks if len(a) > 0]
|
||||
|
||||
def summarize(ck_idx, lock):
|
||||
@ -66,7 +67,8 @@ class RecursiveAbstractiveProcessing4TreeOrganizedRetrieval:
|
||||
logging.debug(f"SUM: {cnt}")
|
||||
embds, _ = self._embd_model.encode([cnt])
|
||||
with lock:
|
||||
if not len(embds[0]): return
|
||||
if not len(embds[0]):
|
||||
return
|
||||
chunks.append((cnt, embds[0]))
|
||||
except Exception as e:
|
||||
logging.exception("summarize got exception")
|
||||
|
||||
Reference in New Issue
Block a user