From a3eeb5de323e044426a6e13c1bf67fe69682228a Mon Sep 17 00:00:00 2001 From: balibabu Date: Wed, 25 Dec 2024 19:11:16 +0800 Subject: [PATCH] Fix: Q&A chunk modification (#4227) ### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/apps/chunk_app.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/apps/chunk_app.py b/api/apps/chunk_app.py index 644353ba6..feeb52f6e 100644 --- a/api/apps/chunk_app.py +++ b/api/apps/chunk_app.py @@ -148,10 +148,7 @@ def set(): t for t in re.split( r"[\n\t]", req["content_with_weight"]) if len(t) > 1] - if len(arr) != 2: - return get_data_error_result( - message="Q&A must be separated by TAB/ENTER key.") - q, a = rmPrefix(arr[0]), rmPrefix(arr[1]) + q, a = rmPrefix(arr[0]), rmPrefix("\n".join(arr[1:])) d = beAdoc(d, arr[0], arr[1], not any( [rag_tokenizer.is_chinese(t) for t in q + a]))