mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 15:48:59 +08:00
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 <zhudan187@qq.com>
This commit is contained in:
parent
be6d5b76c3
commit
c0090a1b4f
@ -230,7 +230,6 @@ def create():
|
|||||||
tenant_id, LLMType.EMBEDDING.value, embd_id)
|
tenant_id, LLMType.EMBEDDING.value, embd_id)
|
||||||
|
|
||||||
v, c = embd_mdl.encode([doc.name, req["content_with_weight"]])
|
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]
|
v = 0.1 * v[0] + 0.9 * v[1]
|
||||||
d["q_%d_vec" % len(v)] = v.tolist()
|
d["q_%d_vec" % len(v)] = v.tolist()
|
||||||
ELASTICSEARCH.upsert([d], search.index_name(tenant_id))
|
ELASTICSEARCH.upsert([d], search.index_name(tenant_id))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user