ragflow/rag
dylan e54c0e39b5
fix bug [ERROR][Exception]: 8 vs. 9 (#6955)
### What problem does this PR solve?

Sometimes, the **s** in **chunks (s, a)** is an empty string. This
causes the condition **if s and len(a) > 0** in the line **chunks = [(s,
a) for s, a in chunks if s and len(a) > 0]** to fail, which changes the
length of the new chunks. As a result, the final assertion **assert
len(chunks) - end == n_clusters, "{} vs. {}".format(len(chunks) - end,
n_clusters)** fails and raises a confusing error like 7 vs. 8

### 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):
2025-04-11 17:01:49 +08:00
..
app Fix: docx image exceptions. (#6839) 2025-04-07 12:33:34 +08:00
llm Fix: local variable referenced before assignment (#6909) 2025-04-09 20:29:12 +08:00
nlp Fix: incorrect total chunks count in retrieval function after similarity filtering (#6741) (#6932) 2025-04-11 12:31:36 +08:00
res Format file format from Windows/dos to Unix (#1949) 2024-08-15 09:17:36 +08:00
svr Optimize graphrag again (#6513) 2025-03-26 15:34:42 +08:00
utils Fix set_graph on non-existing edge (#6777) 2025-04-03 11:09:04 +08:00
__init__.py Update comments (#4569) 2025-01-21 20:52:28 +08:00
benchmark.py Refactor embedding batch_size (#3825) 2024-12-03 16:22:39 +08:00
prompts.py Added similarity scores in reference chunks (#6918) 2025-04-10 19:17:45 +08:00
raptor.py fix bug [ERROR][Exception]: 8 vs. 9 (#6955) 2025-04-11 17:01:49 +08:00
settings.py Fix: optimize setting config initialization to resolve Minio initialization error (#6282) 2025-03-20 10:45:40 +08:00