Fix logs. Use dict.pop instead of del. Close #3473 (#3484)

### What problem does this PR solve?

Fix logs. Use dict.pop instead of del.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Zhichang Yu
2024-11-19 14:15:25 +08:00
committed by GitHub
parent d0f94a42ff
commit dec9b3e540
13 changed files with 93 additions and 79 deletions

View File

@ -37,7 +37,6 @@ from api.db.services.document_service import DocumentService
from api.db.services.file2document_service import File2DocumentService
from api.db.services.file_service import FileService
from api.db.services.knowledgebase_service import KnowledgebaseService
from api import settings
from api.utils.api_utils import construct_json_result, get_parser_config
from rag.nlp import search
from rag.utils import rmSpace
@ -1342,8 +1341,7 @@ def retrieval_test(tenant_id):
highlight=highlight,
)
for c in ranks["chunks"]:
if "vector" in c:
del c["vector"]
c.pop("vector", None)
##rename keys
renamed_chunks = []