From 55de16374b0a3780a4e4347466747a3e32e61d7c Mon Sep 17 00:00:00 2001 From: liukuikun <24622904+Harold-lkk@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:23:40 +0800 Subject: [PATCH] enchance app.py (#9) --- README.md | 21 ++++++++++++++++++--- README_zh-CN.md | 18 +++++++++++++++--- frontend/React/src/config/cgi.ts | 2 +- frontend/React/src/pages/render/index.tsx | 2 +- mindsearch/agent/__init__.py | 6 ++++-- mindsearch/agent/mindsearch_agent.py | 2 +- mindsearch/app.py | 15 ++++++++++++++- 7 files changed, 54 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 231734e..2ce8102 100644 --- a/README.md +++ b/README.md @@ -51,9 +51,15 @@ pip install -r requirements.txt Setup FastAPI Server. ```bash -python -m mindsearch.app +python -m mindsearch.app --lang en --model_format internlm_server ``` +- `--lang`: language of the model, `en` for English and `zh` for Chinese. +- `--model_format`: format of the model. + `internlm_server` for InternLM2.5-7b-chat with local server. + `gpt4` for GPT4. + if you want to use other models, please modify [models](mindsearch\agent\models.py) + ### Setup MindSearch Frontend Providing following frontend interfaces: @@ -61,6 +67,15 @@ Providing following frontend interfaces: - React ```bash +# Install Node.js and npm +# for Ubuntu +sudo apt install nodejs npm + +# for windows +# download from https://nodejs.org/zh-cn/download/prebuilt-installer + +# Install dependencies + cd frontend/React npm install npm start @@ -94,12 +109,12 @@ If you find this project useful in your research, please consider cite: ``` @misc{chen2024mindsearchmimickinghumanminds, - title={MindSearch: Mimicking Human Minds Elicits Deep AI Searcher}, + title={MindSearch: Mimicking Human Minds Elicits Deep AI Searcher}, author={Zehui Chen and Kuikun Liu and Qiuchen Wang and Jiangning Liu and Wenwei Zhang and Kai Chen and Feng Zhao}, year={2024}, eprint={2407.20183}, archivePrefix={arXiv}, primaryClass={cs.CL}, - url={https://arxiv.org/abs/2407.20183}, + url={https://arxiv.org/abs/2407.20183}, } ``` diff --git a/README_zh-CN.md b/README_zh-CN.md index b9ac647..b8b658e 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -51,9 +51,15 @@ pip install -r requirements.txt 启动 FastAPI 服务器 ```bash -python -m mindsearch.app +python -m mindsearch.app --lang en --model_format internlm_server ``` +- `--lang`: 模型的语言,`en` 为英语,`zh` 为中文。 +- `--model_format`: 模型的格式。 + `internlm_server` 为 InternLM2.5-7b-chat 本地服务器。 + `gpt4` 为 GPT4。 + 如果您想使用其他模型,请修改 [models](mindsearch\agent\models.py) + ### 启动 MindSearch 前端 提供以下几种前端界面: @@ -61,6 +67,12 @@ python -m mindsearch.app - React ```bash +# 安装 Node.js 和 npm +# 对于 Ubuntu +sudo apt install nodejs npm +# 对于 Windows +# 从 https://nodejs.org/zh-cn/download/prebuilt-installer 下载 + cd frontend/React npm install npm start @@ -94,12 +106,12 @@ python mindsearch/terminal.py ``` @misc{chen2024mindsearchmimickinghumanminds, - title={MindSearch: Mimicking Human Minds Elicits Deep AI Searcher}, + title={MindSearch: Mimicking Human Minds Elicits Deep AI Searcher}, author={Zehui Chen and Kuikun Liu and Qiuchen Wang and Jiangning Liu and Wenwei Zhang and Kai Chen and Feng Zhao}, year={2024}, eprint={2407.20183}, archivePrefix={arXiv}, primaryClass={cs.CL}, - url={https://arxiv.org/abs/2407.20183}, + url={https://arxiv.org/abs/2407.20183}, } ``` diff --git a/frontend/React/src/config/cgi.ts b/frontend/React/src/config/cgi.ts index fe7ba7f..5fa5395 100644 --- a/frontend/React/src/config/cgi.ts +++ b/frontend/React/src/config/cgi.ts @@ -1,2 +1,2 @@ export const mode = import.meta.env.MODE; -export const GET_SSE_DATA = '/solve'; +export const GET_SSE_DATA = 'http://127.0.0.1:8002/solve'; diff --git a/frontend/React/src/pages/render/index.tsx b/frontend/React/src/pages/render/index.tsx index 515b648..d37bbe0 100644 --- a/frontend/React/src/pages/render/index.tsx +++ b/frontend/React/src/pages/render/index.tsx @@ -579,7 +579,7 @@ const RenderTest = () => { 发送 -