Support debug components. (#3994)

### What problem does this PR solve?

#3993

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2024-12-11 19:23:59 +08:00
committed by GitHub
parent f61c276f74
commit 6d19294ddc
8 changed files with 63 additions and 15 deletions

View File

@ -54,7 +54,7 @@ from rag.app import laws, paper, presentation, manual, qa, table, book, resume,
from rag.nlp import search, rag_tokenizer
from rag.raptor import RecursiveAbstractiveProcessing4TreeOrganizedRetrieval as Raptor
from rag.settings import DOC_MAXIMUM_SIZE, SVR_QUEUE_NAME, print_rag_settings
from rag.utils import rmSpace, num_tokens_from_string
from rag.utils import num_tokens_from_string
from rag.utils.redis_conn import REDIS_CONN, Payload
from rag.utils.storage_factory import STORAGE_IMPL
@ -269,7 +269,7 @@ def embedding(docs, mdl, parser_config=None, callback=None):
batch_size = 16
tts, cnts = [], []
for d in docs:
tts.append(rmSpace(d.get("docnm_kwd", "Title")))
tts.append(d.get("docnm_kwd", "Title"))
c = "\n".join(d.get("question_kwd", []))
if not c:
c = d["content_with_weight"]