balibabu
commited on
Commit
·
21e42fc
1
Parent(s):
2eb2b2e
Fix: Q&A chunk modification (#4227)
Browse files### 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 +1 -4
api/apps/chunk_app.py
CHANGED
@@ -148,10 +148,7 @@ def set():
|
|
148 |
t for t in re.split(
|
149 |
r"[\n\t]",
|
150 |
req["content_with_weight"]) if len(t) > 1]
|
151 |
-
|
152 |
-
return get_data_error_result(
|
153 |
-
message="Q&A must be separated by TAB/ENTER key.")
|
154 |
-
q, a = rmPrefix(arr[0]), rmPrefix(arr[1])
|
155 |
d = beAdoc(d, arr[0], arr[1], not any(
|
156 |
[rag_tokenizer.is_chinese(t) for t in q + a]))
|
157 |
|
|
|
148 |
t for t in re.split(
|
149 |
r"[\n\t]",
|
150 |
req["content_with_weight"]) if len(t) > 1]
|
151 |
+
q, a = rmPrefix(arr[0]), rmPrefix("\n".join(arr[1:]))
|
|
|
|
|
|
|
152 |
d = beAdoc(d, arr[0], arr[1], not any(
|
153 |
[rag_tokenizer.is_chinese(t) for t in q + a]))
|
154 |
|