From ded9bf80c5f7e6aa0db2a0a56044eaca147454e0 Mon Sep 17 00:00:00 2001 From: buua436 <66937541+buua436@users.noreply.github.com> Date: Tue, 18 Nov 2025 15:24:27 +0800 Subject: [PATCH] Fix:limit random sampling range in check_embedding (#11337) ### What problem does this PR solve? issue: [#11319](https://github.com/infiniflow/ragflow/issues/11319) change: limit random sampling range in check_embedding ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/apps/kb_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/apps/kb_app.py b/api/apps/kb_app.py index 53e42303f..d0c4469dd 100644 --- a/api/apps/kb_app.py +++ b/api/apps/kb_app.py @@ -819,7 +819,7 @@ def check_embedding(): return [] n = min(n, total) - offsets = sorted(random.sample(range(total), n)) + offsets = sorted(random.sample(range(min(total,1000)), n)) out = [] for off in offsets: