MindSearch icon indicating copy to clipboard operation
MindSearch copied to clipboard

Bug: Fix searcher_resp_queue not available sometimes

Open richard1122 opened this issue 1 year ago • 4 comments

The graph may not be ready when we try to access it for the first time. Sometimes the code returned by LLM (gpt4o for example), especially the first line graph = WebSearchGraph(), has not been executed yet. This PR adds a retry mechanism when accessing graph, which partly fixes issue #36 #17.

image

richard1122 avatar Aug 03 '24 03:08 richard1122

Thank you so much for your PR! I appreciate your contribution to the project.

I've reviewed the code and have a few comments and suggestions for improvement:

  1. continue runs the risk of making the execute_code function fall into a dead loop. By using raise without any arguments in the except block of func run_command, it will re-raise the caught exception, preserving the original traceback information.

liujiangning30 avatar Aug 05 '24 08:08 liujiangning30

Hi @liujiangning30, I'm not quite understand your comment, like

By using raise without any arguments in the except block of func run_command, it will re-raise the caught exception, preserving the original traceback information.

Are you suggesting to add a limit (like 5 times) of retry, then raise an exception?

richard1122 avatar Aug 05 '24 09:08 richard1122

Yes

Hi @liujiangning30, I'm not quite understand your comment, like

By using raise without any arguments in the except block of func run_command, it will re-raise the caught exception, preserving the original traceback information.

Are you suggesting to add a limit (like 5 times) of retry, then raise an exception?

liujiangning30 avatar Aug 05 '24 09:08 liujiangning30

我这边正好相反,我这边的case一直都获取不到结果,是因为python执行器的问题,而且建议上面加一个重试次数的限制!https://github.com/InternLM/MindSearch/issues/36

datalee avatar Aug 07 '24 04:08 datalee