From fc7cb1cce3179ada5cb0acb928c797941fc2face Mon Sep 17 00:00:00 2001 From: csunny Date: Sun, 25 Jun 2023 23:05:50 +0800 Subject: [PATCH 1/4] feat: add chatglm2-6b support --- docs/getting_started/getting_started.md | 1 + docs/modules/llms.md | 6 ++++++ pilot/configs/model_config.py | 1 + 3 files changed, 8 insertions(+) diff --git a/docs/getting_started/getting_started.md b/docs/getting_started/getting_started.md index d082a0c75..33653f248 100644 --- a/docs/getting_started/getting_started.md +++ b/docs/getting_started/getting_started.md @@ -38,6 +38,7 @@ Once the environment is installed, we have to create a new folder "models" in th git clone https://huggingface.co/Tribbiani/vicuna-13b git clone https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese +git clone https://huggingface.co/THUDM/chatglm2-6b ``` The model files are large and will take a long time to download. During the download, let's configure the .env file, which needs to be copied and created from the .env.template diff --git a/docs/modules/llms.md b/docs/modules/llms.md index 217961a51..bec64313e 100644 --- a/docs/modules/llms.md +++ b/docs/modules/llms.md @@ -17,6 +17,12 @@ if you want use other model, such as chatglm-6b, you just need update .env confi ``` LLM_MODEL=chatglm-6b ``` +or chatglm2-6b, which is the second-generation version of the open-source bilingual (Chinese-English) chat model ChatGLM-6B. +``` +LLM_MODEL=chatglm2-6b +``` + + ## Run Model with cpu. we alse support smaller models, like gpt4all. you can use it with cpu/mps(M1/M2), Download from [gpt4all model](https://gpt4all.io/models/ggml-gpt4all-j-v1.3-groovy.bin) diff --git a/pilot/configs/model_config.py b/pilot/configs/model_config.py index f6d59e4e1..2f44fc520 100644 --- a/pilot/configs/model_config.py +++ b/pilot/configs/model_config.py @@ -39,6 +39,7 @@ LLM_MODEL_CONFIG = { "codet5p-2b": os.path.join(MODEL_PATH, "codet5p-2b"), "chatglm-6b-int4": os.path.join(MODEL_PATH, "chatglm-6b-int4"), "chatglm-6b": os.path.join(MODEL_PATH, "chatglm-6b"), + "chatglm2-6b": os.path.join(MODEL_PATH, "chatglm2-6b"), "text2vec-base": os.path.join(MODEL_PATH, "text2vec-base-chinese"), "guanaco-33b-merged": os.path.join(MODEL_PATH, "guanaco-33b-merged"), "falcon-40b": os.path.join(MODEL_PATH, "falcon-40b"), From a9fc9f0929dd070f6236a08afa91bbf249e30d44 Mon Sep 17 00:00:00 2001 From: csunny Date: Sun, 25 Jun 2023 23:07:41 +0800 Subject: [PATCH 2/4] feat: support chatglm2-6b --- docs/conf.py | 2 +- docs/locales/zh_CN/LC_MESSAGES/modules/llms.po | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e00f95f06..04800c71e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,7 @@ project = "DB-GPT" copyright = "2023, csunny" author = "csunny" -version = "👏👏 0.2.2" +version = "👏👏 0.2.3" html_title = project + " " + version # -- General configuration --------------------------------------------------- diff --git a/docs/locales/zh_CN/LC_MESSAGES/modules/llms.po b/docs/locales/zh_CN/LC_MESSAGES/modules/llms.po index e230efde5..7462da33f 100644 --- a/docs/locales/zh_CN/LC_MESSAGES/modules/llms.po +++ b/docs/locales/zh_CN/LC_MESSAGES/modules/llms.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: DB-GPT 0.1.0\n" +"Project-Id-Version: DB-GPT 0.2.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-14 22:33+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/setup.py b/setup.py index b0732aeda..46dea861b 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ def parse_requirements(file_name: str) -> List[str]: setuptools.setup( name="DB-GPT", packages=find_packages(), - version="0.2.2", + version="0.2.3", author="csunny", author_email="cfqcsunny@gmail.com", description="DB-GPT is an experimental open-source project that uses localized GPT large models to interact with your data and environment." From 53cb9d3fcacb735319c7c94f5b3e99f2e72aaa1b Mon Sep 17 00:00:00 2001 From: csunny Date: Sun, 25 Jun 2023 23:23:37 +0800 Subject: [PATCH 3/4] docs: update readme for new llm support --- README.md | 3 ++- README.zh.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 41084d2c9..75adc94df 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,11 @@ As large models are released and iterated upon, they are becoming increasingly i DB-GPT is an experimental open-source project that uses localized GPT large models to interact with your data and environment. With this solution, you can be assured that there is no risk of data leakage, and your data is 100% private and secure. ## News +- [2023/06/25]🔥support chatglm2-6b model. [documents](https://db-gpt.readthedocs.io/en/latest/modules/llms.html) - [2023/06/14] support gpt4all model, which can run at M1/M2, or cpu machine. [documents](https://db-gpt.readthedocs.io/en/latest/modules/llms.html) - [2023/06/01]🔥 On the basis of the Vicuna-13B basic model, task chain calls are implemented through plugins. For example, the implementation of creating a database with a single sentence.[demo](./assets/auto_plugin.gif) - [2023/06/01]🔥 QLoRA guanaco(7b, 13b, 33b) support. -- [2023/05/28]🔥 Learning from crawling data from the Internet [demo](./assets/chaturl_en.gif) +- [2023/05/28] Learning from crawling data from the Internet [demo](./assets/chaturl_en.gif) - [2023/05/21] Generate SQL and execute it automatically. [demo](./assets/auto_sql_en.gif) - [2023/05/15] Chat with documents. [demo](./assets/new_knownledge_en.gif) - [2023/05/06] SQL generation and diagnosis. [demo](./assets/demo_en.gif) diff --git a/README.zh.md b/README.zh.md index 544fca460..612011db2 100644 --- a/README.zh.md +++ b/README.zh.md @@ -23,6 +23,7 @@ DB-GPT 是一个开源的以数据库为基础的GPT实验项目,使用本地 ## 最新发布 +- [2023/06/25]🔥 支持ChatGLM2-6B模型。 [使用文档](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/modules/llms.html) - [2023/06/14]🔥 支持gpt4all模型,可以在M1/M2 或者CPU机器上运行。 [使用文档](https://db-gpt.readthedocs.io/projects/db-gpt-docs-zh-cn/zh_CN/latest/modules/llms.html) - [2023/06/01]🔥 在Vicuna-13B基础模型的基础上,通过插件实现任务链调用。例如单句创建数据库的实现. - [2023/06/01]🔥 QLoRA guanaco(原驼)支持, 支持4090运行33B From 132f8fff0181317195e1ef3ce61ad02e31177952 Mon Sep 17 00:00:00 2001 From: "magic.chen" Date: Sun, 25 Jun 2023 23:29:43 +0800 Subject: [PATCH 4/4] Update model_config.py --- pilot/configs/model_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pilot/configs/model_config.py b/pilot/configs/model_config.py index 2f44fc520..30124461d 100644 --- a/pilot/configs/model_config.py +++ b/pilot/configs/model_config.py @@ -40,6 +40,7 @@ LLM_MODEL_CONFIG = { "chatglm-6b-int4": os.path.join(MODEL_PATH, "chatglm-6b-int4"), "chatglm-6b": os.path.join(MODEL_PATH, "chatglm-6b"), "chatglm2-6b": os.path.join(MODEL_PATH, "chatglm2-6b"), + "chatglm2-6b-int4": os.path.join(MODEL_PATH, "chatglm2-6b-int4"), "text2vec-base": os.path.join(MODEL_PATH, "text2vec-base-chinese"), "guanaco-33b-merged": os.path.join(MODEL_PATH, "guanaco-33b-merged"), "falcon-40b": os.path.join(MODEL_PATH, "falcon-40b"),