From 1b4016317e643cc93bb4530719f67f11d378c534 Mon Sep 17 00:00:00 2001 From: QuintinTao <72123724+QuintinTao@users.noreply.github.com> Date: Fri, 18 Apr 2025 14:42:36 +0800 Subject: [PATCH] fix bug chunking:expected string or bytes-like object (#7116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … bytes-like object ### What problem does this PR solve? fix bug #6990 internal server error ehile chunking:expected string or bytes-like object _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) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe): Co-authored-by: unknown --- rag/app/table.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rag/app/table.py b/rag/app/table.py index 6ecab0427..14facd169 100644 --- a/rag/app/table.py +++ b/rag/app/table.py @@ -193,6 +193,9 @@ def chunk(filename, binary=None, from_page=0, to_page=10000000000, if n in df.columns: del df[n] clmns = df.columns.values + if len(clmns) != len(set(clmns)): + duplicates = [col for col in clmns if list(clmns).count(col) > 1] + raise ValueError(f"Duplicate column names detected: {set(duplicates)}") txts = list(copy.deepcopy(clmns)) py_clmns = [ PY.get_pinyins(