diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.py index b31057bc08..548d88ab1b 100644 --- a/rag/svr/task_executor.py +++ b/rag/svr/task_executor.py @@ -640,7 +640,8 @@ async def embedding(docs, mdl, parser_config=None, callback=None): if not c: c = d["content_with_weight"] c = re.sub(r"]{0,12})?>", " ", c) - if not c: + if not c.strip(): + logging.debug("embedding(): normalized whitespace-only chunk to placeholder 'None' (len=%d)", len(c)) c = "None" cnts.append(c)