From 0d714476872ef385bd0c20825c461bfb4baffc3f Mon Sep 17 00:00:00 2001 From: wanyaokun <12345678> Date: Tue, 20 Aug 2024 18:53:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E7=BB=84=E6=BA=A2?= =?UTF-8?q?=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/xinference/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/xinference/base.py b/backend/app/xinference/base.py index 374c2ca..f256ec8 100644 --- a/backend/app/xinference/base.py +++ b/backend/app/xinference/base.py @@ -224,8 +224,8 @@ class XinferenceRerank(BaseNodePostprocessor): if self.top_n is not None: if len(new_nodes) > self.top_n: - for index in new_nodes[5:-1]: - new_nodes.remove(-1) + for index in new_nodes[self.top_n:-1]: + new_nodes.remove(index) event.on_end(payload={EventPayload.NODES: new_nodes})