InternLM / InternLM/MindSearch
graph.py的add_node函数中存在bug
Open
- Dominant language
- JavaScript
- Stars
- 6.9k
- Forks
- 692
- PR merge metrics
- No merged PRs in 30d
Description
再graph.py的add_node函数中存在逻辑上的bug。我们在添加当前节点的时候,想获取父节点的问答对来构建parent_response。但是构建parent_response的逻辑是在add_edge之前,导致在add_node中遍历adjacency_list时,adjacency_list中相邻节点永远不会包含当前节点,所以parent_response永远都为空。

比如这里,current node为"诺布朗杰作品",其parent node为“作词人”,adjacency_list[“作词人”] = [],因此parent_nodes构建为[],parent_resonse也为[]。这样后面searcher中构建prompt时会缺失父节点的问答信息。
我将代码修改如下:

这样就可以在add_node时正常获取当前节点的父节点的问答对。
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.