From 57c73b14241a7ac3fa7982727f0dbbed369b9939 Mon Sep 17 00:00:00 2001 From: zR <2448370773@qq.com> Date: Mon, 22 Jan 2024 20:46:04 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 11 ++++++----- requirements_api.txt | 2 +- requirements_lite.txt | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index 4307ab9d..4fdc9b80 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,9 +13,9 @@ fastapi~=0.109.0 sse_starlette~=1.8.2 nltk~=3.8.1 uvicorn~=0.24.0.post1 -starlette~=0.32.0 +starlette~=0.35.0 unstructured[all-docs]~=0.12.0 -python-magic-bin; sys_platform ~= 'win32' +python-magic-bin; sys_platform == 'win32' SQLAlchemy~=2.0.25 faiss-cpu~=1.7.4 accelerate~=0.24.1 @@ -35,7 +35,7 @@ numpy~=1.24.4 pandas~=2.0.3 einops~=0.7.0 transformers_stream_generator~=0.0.4 -vllm~=0.2.7; sys_platform ~= "linux" +vllm~=0.2.7; sys_platform == "linux" jq~=1.6.0 beautifulsoup4~=4.12.2 pysrt~=1.1.2 @@ -46,7 +46,7 @@ dashscope~=1.13.6 # qwen # psycopg2~=2.9.9 # pgvector~=0.2.4 # flash-attn~=2.4.3 # For Orion-14B-Chat and Qwen-14B-Chat -#rapidocr_paddle[gpu]~=1.3.0.post5 # gpu accelleration for ocr of pdf and image files +rapidocr_paddle[gpu]~=1.3.0.post5 # gpu accelleration for ocr of pdf and image files arxiv~=2.1.0 youtube-search~=2.1.2 duckduckgo-search~=3.9.9 @@ -58,4 +58,5 @@ streamlit-chatbox~=1.1.11 streamlit-modal~=0.1.0 streamlit-aggrid~=0.3.4.post3 httpx~=0.26.0 -watchdog~=3.0.0 \ No newline at end of file +watchdog~=3.0.0 +jwt~=1.3.1 \ No newline at end of file diff --git a/requirements_api.txt b/requirements_api.txt index 81660dae..ffc1749e 100644 --- a/requirements_api.txt +++ b/requirements_api.txt @@ -13,7 +13,7 @@ fastapi~=0.108.0 sse_starlette==1.8.2 nltk>=3.8.1 uvicorn>=0.24.0.post1 -starlette~=0.32.0 +starlette~=0.35.0 unstructured[all-docs]==0.11.0 python-magic-bin; sys_platform == 'win32' SQLAlchemy==2.0.19 diff --git a/requirements_lite.txt b/requirements_lite.txt index 5a0ace76..65b782e4 100644 --- a/requirements_lite.txt +++ b/requirements_lite.txt @@ -7,9 +7,9 @@ fastapi~=0.109.0 sse_starlette~=1.8.2 nltk~=3.8.1 uvicorn~=0.24.0.post1 -starlette~=0.32.0 +starlette~=0.35.0 unstructured[all-docs]~=0.12.0 -python-magic-bin; sys_platform ~= 'win32' +python-magic-bin; sys_platform == 'win32' SQLAlchemy~=2.0.25 faiss-cpu~=1.7.4 accelerate~=0.24.1 From 6df6ed292075c0e922e4bc2a68a0aa59090615e4 Mon Sep 17 00:00:00 2001 From: zR <2448370773@qq.com> Date: Mon, 22 Jan 2024 20:46:34 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements_api.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_api.txt b/requirements_api.txt index ffc1749e..17115351 100644 --- a/requirements_api.txt +++ b/requirements_api.txt @@ -9,7 +9,7 @@ langchain-experimental==0.0.47 pydantic==1.10.13 fschat==0.2.35 openai~=1.9.0 -fastapi~=0.108.0 +fastapi~=0.109.0 sse_starlette==1.8.2 nltk>=3.8.1 uvicorn>=0.24.0.post1 From 60d5f7d4393bc09244a0001fe96765ebbbe6f2de Mon Sep 17 00:00:00 2001 From: imClumsyPanda Date: Mon, 22 Jan 2024 23:29:06 +0800 Subject: [PATCH 3/6] update req --- configs/model_config.py.example | 1 + requirements.txt | 114 ++++++++++++++++---------------- 2 files changed, 58 insertions(+), 57 deletions(-) diff --git a/configs/model_config.py.example b/configs/model_config.py.example index d7053564..09a019a6 100644 --- a/configs/model_config.py.example +++ b/configs/model_config.py.example @@ -224,6 +224,7 @@ MODEL_PATH = { "dolly-v2-12b": "databricks/dolly-v2-12b", "stablelm-tuned-alpha-7b": "stabilityai/stablelm-tuned-alpha-7b", }, + "reranker": { "bge-reranker-large": "BAAI/bge-reranker-large", "bge-reranker-base": "BAAI/bge-reranker-base", diff --git a/requirements.txt b/requirements.txt index 4fdc9b80..ecfd6d47 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,62 +1,62 @@ -torch~=2.1.2 -torchvision~=0.16.2 -torchaudio~=2.1.2 -xformers~=0.0.23.post1 -transformers~=4.36.2 -sentence_transformers~=2.2.2 +torch==2.1.2 +torchvision==0.16.2 +torchaudio==2.1.2 +xformers==0.0.23.post1 +transformers==4.36.2 +sentence_transformers==2.2.2 langchain==0.0.354 langchain-experimental==0.0.47 pydantic==1.10.13 -fschat~=0.2.35 -openai~=1.9.0 -fastapi~=0.109.0 -sse_starlette~=1.8.2 -nltk~=3.8.1 -uvicorn~=0.24.0.post1 -starlette~=0.35.0 -unstructured[all-docs]~=0.12.0 +fschat==0.2.35 +openai==1.9.0 +fastapi==0.109.0 +sse_starlette==1.8.2 +nltk==3.8.1 +uvicorn==0.24.0.post1 +starlette==0.35.0 +unstructured[all-docs] # ==0.11.8 python-magic-bin; sys_platform == 'win32' -SQLAlchemy~=2.0.25 -faiss-cpu~=1.7.4 -accelerate~=0.24.1 -spacy~=3.7.2 -PyMuPDF~=1.23.16 -rapidocr_onnxruntime~=1.3.8 -requests~=2.31.0 -pathlib~=1.0.1 -pytest~=7.4.3 -numexpr~=2.8.6 -strsimpy~=0.2.1 -markdownify~=0.11.6 -tiktoken~=0.5.2 -tqdm~=4.66.1 -websockets~=12.0 -numpy~=1.24.4 -pandas~=2.0.3 -einops~=0.7.0 -transformers_stream_generator~=0.0.4 -vllm~=0.2.7; sys_platform == "linux" -jq~=1.6.0 -beautifulsoup4~=4.12.2 -pysrt~=1.1.2 -dashscope~=1.13.6 # qwen -# volcengine~=1.0.119 # fangzhou +SQLAlchemy==2.0.25 +faiss-cpu==1.7.4 +accelerate==0.24.1 +spacy==3.7.2 +PyMuPDF==1.23.16 +rapidocr_onnxruntime==1.3.8 +requests==2.31.0 +pathlib==1.0.1 +pytest==7.4.3 +numexpr==2.8.6 +strsimpy==0.2.1 +markdownify==0.11.6 +tiktoken==0.5.2 +tqdm==4.66.1 +websockets==12.0 +numpy==1.24.4 +pandas==2.0.3 +einops==0.7.0 +transformers_stream_generator==0.0.4 +vllm==0.2.7; sys_platform == "linux" +jq==1.6.0 +beautifulsoup4==4.12.2 +pysrt==1.1.2 +dashscope==1.13.6 # qwen +# volcengine==1.0.119 # fangzhou # uncomment libs if you want to use corresponding vector store -# pymilvus~=2.3.4 -# psycopg2~=2.9.9 -# pgvector~=0.2.4 -# flash-attn~=2.4.3 # For Orion-14B-Chat and Qwen-14B-Chat -rapidocr_paddle[gpu]~=1.3.0.post5 # gpu accelleration for ocr of pdf and image files -arxiv~=2.1.0 -youtube-search~=2.1.2 -duckduckgo-search~=3.9.9 -metaphor-python~=0.1.23 -streamlit~=1.30.0 -streamlit-option-menu~=0.3.12 -streamlit-antd-components~=0.3.1 -streamlit-chatbox~=1.1.11 -streamlit-modal~=0.1.0 -streamlit-aggrid~=0.3.4.post3 -httpx~=0.26.0 -watchdog~=3.0.0 -jwt~=1.3.1 \ No newline at end of file +# pymilvus==2.3.4 +# psycopg2==2.9.9 +# pgvector==0.2.4 +# flash-attn==2.4.3 # For Orion-14B-Chat and Qwen-14B-Chat +# rapidocr_paddle[gpu]==1.3.0.post5 # gpu accelleration for ocr of pdf and image files +arxiv==2.1.0 +youtube-search==2.1.2 +duckduckgo-search==3.9.9 +metaphor-python==0.1.23 +streamlit==1.30.0 +streamlit-option-menu==0.3.12 +streamlit-antd-components==0.3.1 +streamlit-chatbox==1.1.11 +streamlit-modal==0.1.0 +streamlit-aggrid==0.3.4.post3 +httpx==0.26.0 +watchdog==3.0.0 +jwt==1.3.1 \ No newline at end of file From 7248163b07b67613867d5eaccf3db136b24e0df9 Mon Sep 17 00:00:00 2001 From: liunux4odoo Date: Tue, 23 Jan 2024 13:11:15 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=EF=BC=9B=E4=BC=98=E5=8C=96webui=E6=A8=A1=E5=9E=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=9B=E6=9B=B4=E6=96=B0wiki=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- knowledge_base/samples/content/wiki | 2 +- requirements.txt | 11 +++++++---- requirements_api.txt | 19 ++++++++++--------- requirements_lite.txt | 2 ++ webui_pages/dialogue/dialogue.py | 6 +++--- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/knowledge_base/samples/content/wiki b/knowledge_base/samples/content/wiki index 2f24adb2..28f664aa 160000 --- a/knowledge_base/samples/content/wiki +++ b/knowledge_base/samples/content/wiki @@ -1 +1 @@ -Subproject commit 2f24adb218f23eab00d7fcd7ccf5072f2f35cb3c +Subproject commit 28f664aa08f8191a70339c9ecbe7a89b35a1032a diff --git a/requirements.txt b/requirements.txt index ecfd6d47..887d67cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -36,10 +36,12 @@ pandas==2.0.3 einops==0.7.0 transformers_stream_generator==0.0.4 vllm==0.2.7; sys_platform == "linux" -jq==1.6.0 -beautifulsoup4==4.12.2 -pysrt==1.1.2 -dashscope==1.13.6 # qwen +llama-index==0.9.35 + +# jq==1.6.0 +# beautifulsoup4==4.12.2 +# pysrt==1.1.2 +# dashscope==1.13.6 # qwen # volcengine==1.0.119 # fangzhou # uncomment libs if you want to use corresponding vector store # pymilvus==2.3.4 @@ -47,6 +49,7 @@ dashscope==1.13.6 # qwen # pgvector==0.2.4 # flash-attn==2.4.3 # For Orion-14B-Chat and Qwen-14B-Chat # rapidocr_paddle[gpu]==1.3.0.post5 # gpu accelleration for ocr of pdf and image files + arxiv==2.1.0 youtube-search==2.1.2 duckduckgo-search==3.9.9 diff --git a/requirements_api.txt b/requirements_api.txt index 17115351..e726271a 100644 --- a/requirements_api.txt +++ b/requirements_api.txt @@ -37,15 +37,16 @@ einops>=0.7.0 transformers_stream_generator==0.0.4 vllm==0.2.7; sys_platform == "linux" httpx==0.26.0 -llama-index -jq==1.6.0 -beautifulsoup4~=4.12.2 -pysrt~=1.1.2 -dashscope==1.13.6 -arxiv~=2.1.0 -youtube-search~=2.1.2 -duckduckgo-search~=3.9.9 -metaphor-python~=0.1.23 +llama-index==0.9.35 + +# jq==1.6.0 +# beautifulsoup4~=4.12.2 +# pysrt~=1.1.2 +# dashscope==1.13.6 +# arxiv~=2.1.0 +# youtube-search~=2.1.2 +# duckduckgo-search~=3.9.9 +# metaphor-python~=0.1.23 # volcengine>=1.0.119 # pymilvus>=2.3.4 diff --git a/requirements_lite.txt b/requirements_lite.txt index 65b782e4..408033d4 100644 --- a/requirements_lite.txt +++ b/requirements_lite.txt @@ -19,6 +19,8 @@ rapidocr_onnxruntime~=1.3.8 requests~=2.31.0 pathlib~=1.0.1 pytest~=7.4.3 +llama-index==0.9.35 + dashscope==1.13.6 arxiv~=2.1.0 youtube-search~=2.1.2 diff --git a/webui_pages/dialogue/dialogue.py b/webui_pages/dialogue/dialogue.py index b9d2f7fd..9efbe1d4 100644 --- a/webui_pages/dialogue/dialogue.py +++ b/webui_pages/dialogue/dialogue.py @@ -6,7 +6,7 @@ from datetime import datetime import os import re import time -from configs import (TEMPERATURE, HISTORY_LEN, PROMPT_TEMPLATES, +from configs import (TEMPERATURE, HISTORY_LEN, PROMPT_TEMPLATES, LLM_MODELS, DEFAULT_KNOWLEDGE_BASE, DEFAULT_SEARCH_ENGINE, SUPPORT_AGENT_MODEL) from server.knowledge_base.utils import LOADER_DICT import uuid @@ -168,8 +168,8 @@ def dialogue_page(api: ApiRequest, is_lite: bool = False): if (v.get("model_path_exists") and k not in running_models): available_models.append(k) - for k, v in config_models.get("online", {}).items(): # 列出ONLINE_MODELS中直接访问的模型 - if not v.get("provider") and k not in running_models: + for k, v in config_models.get("online", {}).items(): # 列出ONLINE_MODELS中可直接访问且在LLM_MODELS中配置的模型 + if not v.get("provider") and k not in running_models and k in LLM_MODELS: available_models.append(k) llm_models = running_models + available_models cur_llm_model = st.session_state.get("cur_llm_model", default_model) From f9a5ae99eeac5e00b81abb4d371124d5b98797b6 Mon Sep 17 00:00:00 2001 From: zR <2448370773@qq.com> Date: Wed, 24 Jan 2024 15:28:34 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E9=83=A8?= =?UTF-8?q?=E5=88=86=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 7 ++++--- requirements_api.txt | 5 +++-- requirements_lite.txt | 3 +-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 887d67cc..adf32a76 100644 --- a/requirements.txt +++ b/requirements.txt @@ -38,7 +38,7 @@ transformers_stream_generator==0.0.4 vllm==0.2.7; sys_platform == "linux" llama-index==0.9.35 -# jq==1.6.0 +#jq==1.6.0 # beautifulsoup4==4.12.2 # pysrt==1.1.2 # dashscope==1.13.6 # qwen @@ -47,8 +47,9 @@ llama-index==0.9.35 # pymilvus==2.3.4 # psycopg2==2.9.9 # pgvector==0.2.4 -# flash-attn==2.4.3 # For Orion-14B-Chat and Qwen-14B-Chat -# rapidocr_paddle[gpu]==1.3.0.post5 # gpu accelleration for ocr of pdf and image files +#flash-attn==2.4.2 # For Orion-14B-Chat and Qwen-14B-Chat +#autoawq==0.1.8 # For Int4 +#rapidocr_paddle[gpu]==1.3.11 # gpu accelleration for ocr of pdf and image files arxiv==2.1.0 youtube-search==2.1.2 diff --git a/requirements_api.txt b/requirements_api.txt index e726271a..4d2ef018 100644 --- a/requirements_api.txt +++ b/requirements_api.txt @@ -52,5 +52,6 @@ llama-index==0.9.35 # pymilvus>=2.3.4 # psycopg2==2.9.9 # pgvector>=0.2.4 -# flash-attn>=2.4.3 # For Orion-14B-Chat and Qwen-14B-Chat -# rapidocr_paddle[gpu]>=1.3.0.post5 \ No newline at end of file +#flash-attn==2.4.2 # For Orion-14B-Chat and Qwen-14B-Chat +#autoawq==0.1.8 # For Int4 +#rapidocr_paddle[gpu]==1.3.11 # gpu accelleration for ocr of pdf and image files \ No newline at end of file diff --git a/requirements_lite.txt b/requirements_lite.txt index 408033d4..6019cefb 100644 --- a/requirements_lite.txt +++ b/requirements_lite.txt @@ -30,5 +30,4 @@ watchdog~=3.0.0 # volcengine>=1.0.119 # pymilvus>=2.3.4 # psycopg2==2.9.9 -# pgvector>=0.2.4 -# flash-attn>=2.4.3 # For Orion-14B-Chat and Qwen-14B-Chat \ No newline at end of file +# pgvector>=0.2.4 \ No newline at end of file From 852ca5f849763c50ca58bac7f07e0c6cd70431ef Mon Sep 17 00:00:00 2001 From: zR <2448370773@qq.com> Date: Wed, 24 Jan 2024 15:57:04 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=A4=E8=A1=8C?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/server_config.py.example | 2 -- webui_pages/dialogue/dialogue.py | 4 ++-- webui_pages/utils.py | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/configs/server_config.py.example b/configs/server_config.py.example index 09b1546b..eea9c34d 100644 --- a/configs/server_config.py.example +++ b/configs/server_config.py.example @@ -40,8 +40,6 @@ FSCHAT_MODEL_WORKERS = { "device": LLM_DEVICE, # False,'vllm',使用的推理加速框架,使用vllm如果出现HuggingFace通信问题,参见doc/FAQ # vllm对一些模型支持还不成熟,暂时默认关闭 - # fschat=0.2.33的代码有bug, 如需使用,源码修改fastchat.server.vllm_worker, - # 将103行中sampling_params = SamplingParams的参数stop=list(stop)修改为stop= [i for i in stop if i!=""] "infer_turbo": False, # model_worker多卡加载需要配置的参数 diff --git a/webui_pages/dialogue/dialogue.py b/webui_pages/dialogue/dialogue.py index 9efbe1d4..bf4a6e69 100644 --- a/webui_pages/dialogue/dialogue.py +++ b/webui_pages/dialogue/dialogue.py @@ -164,11 +164,11 @@ def dialogue_page(api: ApiRequest, is_lite: bool = False): available_models = [] config_models = api.list_config_models() if not is_lite: - for k, v in config_models.get("local", {}).items(): # 列出配置了有效本地路径的模型 + for k, v in config_models.get("local", {}).items(): if (v.get("model_path_exists") and k not in running_models): available_models.append(k) - for k, v in config_models.get("online", {}).items(): # 列出ONLINE_MODELS中可直接访问且在LLM_MODELS中配置的模型 + for k, v in config_models.get("online", {}).items(): if not v.get("provider") and k not in running_models and k in LLM_MODELS: available_models.append(k) llm_models = running_models + available_models diff --git a/webui_pages/utils.py b/webui_pages/utils.py index 5a73e628..818748d6 100644 --- a/webui_pages/utils.py +++ b/webui_pages/utils.py @@ -437,9 +437,6 @@ class ApiRequest: "prompt_name": prompt_name, } - # print(f"received input message:") - # pprint(data) - response = self.post( "/chat/file_chat", json=data,