修改数组溢出问题

This commit is contained in:
wanyaokun
2024-08-20 18:53:19 +08:00
parent 59488ae459
commit 0d71447687
+2 -2
View File
@@ -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})