From c0090a1b4ff7369fe3a29599a7ef31f3bdb366a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E4=B8=8D=E6=B1=9F?= <74400272+Seaver-Zhu@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:36:01 +0800 Subject: [PATCH] fix function create to slove chunk number wrong (#1604) ### What problem does this PR solve? fix function create to slove the problem of creating a chunk and increasing the chunk number by 2. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) #900 --------- Signed-off-by: seaver --- api/apps/chunk_app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/api/apps/chunk_app.py b/api/apps/chunk_app.py index 67d65b930..360e7250f 100644 --- a/api/apps/chunk_app.py +++ b/api/apps/chunk_app.py @@ -230,7 +230,6 @@ def create(): tenant_id, LLMType.EMBEDDING.value, embd_id) v, c = embd_mdl.encode([doc.name, req["content_with_weight"]]) - DocumentService.increment_chunk_num(req["doc_id"], doc.kb_id, c, 1, 0) v = 0.1 * v[0] + 0.9 * v[1] d["q_%d_vec" % len(v)] = v.tolist() ELASTICSEARCH.upsert([d], search.index_name(tenant_id))