mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 04:26:05 +08:00
Fix out of boundary. (#3786)
### What problem does this PR solve? #3769 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
a7efd3cac5
commit
7058ac0041
@ -452,6 +452,7 @@ def delete(tenant_id,chat_id):
|
|||||||
ConversationService.delete_by_id(id)
|
ConversationService.delete_by_id(id)
|
||||||
return get_result()
|
return get_result()
|
||||||
|
|
||||||
|
|
||||||
@manager.route('/sessions/ask', methods=['POST'])
|
@manager.route('/sessions/ask', methods=['POST'])
|
||||||
@token_required
|
@token_required
|
||||||
def ask_about(tenant_id):
|
def ask_about(tenant_id):
|
||||||
@ -471,6 +472,7 @@ def ask_about(tenant_id):
|
|||||||
if kb.chunk_num == 0:
|
if kb.chunk_num == 0:
|
||||||
return get_error_data_result(f"The dataset {kb_id} doesn't own parsed file")
|
return get_error_data_result(f"The dataset {kb_id} doesn't own parsed file")
|
||||||
uid = tenant_id
|
uid = tenant_id
|
||||||
|
|
||||||
def stream():
|
def stream():
|
||||||
nonlocal req, uid
|
nonlocal req, uid
|
||||||
try:
|
try:
|
||||||
|
@ -152,7 +152,7 @@ class RAGFlowPdfParser:
|
|||||||
max(len(up["text"]), len(down["text"])),
|
max(len(up["text"]), len(down["text"])),
|
||||||
len(tks_all) - len(tks_up) - len(tks_down),
|
len(tks_all) - len(tks_up) - len(tks_down),
|
||||||
len(tks_down) - len(tks_up),
|
len(tks_down) - len(tks_up),
|
||||||
tks_down[-1] == tks_up[-1],
|
tks_down[-1] == tks_up[-1] if tks_down and tks_up else False,
|
||||||
max(down["in_row"], up["in_row"]),
|
max(down["in_row"], up["in_row"]),
|
||||||
abs(down["in_row"] - up["in_row"]),
|
abs(down["in_row"] - up["in_row"]),
|
||||||
len(tks_down) == 1 and rag_tokenizer.tag(tks_down[0]).find("n") >= 0,
|
len(tks_down) == 1 and rag_tokenizer.tag(tks_down[0]).find("n") >= 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user