docs: Add metadata FAQ

This commit is contained in:
FangYin Cheng 2023-10-27 18:08:39 +08:00
parent 0e0d34d92a
commit fbcc91a3a8
3 changed files with 144 additions and 48 deletions

View File

@ -100,8 +100,49 @@ pip install --use-pep517 fschat
```
##### Q9: alembic.util.exc.CommandError: Target database is not up to date.
delete files in `DB-GPT/pilot/meta_data/alembic/versions/` and restart.
```commandline
rm -rf DB-GPT/pilot/meta_data/alembic/versions/*
rm -rf DB-GPT/pilot/meta_data/alembic/dbgpt.db
```
##### Q10: How to store DB-GPT metadata into my database
In version 0.4.0, the metadata module of the DB-GPT application has been refactored. All metadata tables will now be automatically saved in the 'dbgpt' database, based on the database type specified in the `.env` file. If you would like to retain the existing data, it is recommended to use a data migration tool to transfer the database table information to the 'dbgpt' database. Additionally, you can change the default database name 'dbgpt' in your `.env` file.
```commandline
### SQLite database (Current default database)
#LOCAL_DB_PATH=data/default_sqlite.db
#LOCAL_DB_TYPE=sqlite
### Mysql database
LOCAL_DB_TYPE=mysql
LOCAL_DB_USER=root
LOCAL_DB_PASSWORD=aa12345678
LOCAL_DB_HOST=127.0.0.1
LOCAL_DB_PORT=3306
# You can change it to your actual metadata database name
LOCAL_DB_NAME=dbgpt
### This option determines the storage location of conversation records. The default is not configured to the old version of duckdb. It can be optionally db or file (if the value is db, the database configured by LOCAL_DB will be used)
CHAT_HISTORY_STORE_TYPE=db
```
##### Q11: pymysql.err.OperationalError: (1142, "ALTER command denied to user '{you db user}'@'{you db host}' for table '{some table name}'")
In version 0.4.0, DB-GPT use migration tool alembic to migrate metadata. If the database user does not have DDL permissions, this error will be reported. You can solve this problem by importing the metadata information separately.
1. Use a privileged user to execute DDL sql file
```bash
mysql -h127.0.0.1 -uroot -paa12345678 < ./assets/schema/knowledge_management.sql
```
2. Run DB-GPT webserver with `--disable_alembic_upgrade`
```bash
python pilot/server/dbgpt_server.py --disable_alembic_upgrade
```
or
```bash
dbgpt start webserver --disable_alembic_upgrade
```

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-19 19:31+0800\n"
"POT-Creation-Date: 2023-10-27 15:57+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@ -20,12 +20,12 @@ msgstr ""
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/faq/deploy/deploy_faq.md:1
#: fb640f7c38744cbf996dcf7f73f325f6
#: 798fb40c5ec941fcb9d6a0795219132f
msgid "Installation FAQ"
msgstr "Installation FAQ"
msgstr "安装 FAQ"
#: ../../getting_started/faq/deploy/deploy_faq.md:5
#: 79fd80e469d14d608554d53a0e0ed2e3
#: 47d0aa43c5fe4ca3a8ceba50c18ba608
#, fuzzy
msgid ""
"Q1: execute `pip install -e .` error, found some package cannot find "
@ -35,18 +35,20 @@ msgstr ""
"cannot find correct version."
#: ../../getting_started/faq/deploy/deploy_faq.md:6
#: f1f6e3291d1446b5bbcf744cd4c4e89a
#: 944761c1ccc543c0a6aa2fad8dc74a32
msgid "change the pip source."
msgstr "替换pip源."
#: ../../getting_started/faq/deploy/deploy_faq.md:13
#: ../../getting_started/faq/deploy/deploy_faq.md:20
#: 68e1b39a08774a81b9061cc5205e4c1c dd34901f446749e998cd34ec5b6c44f4
#: ../../getting_started/faq/deploy/deploy_faq.md:145
#: 3cff7ea0ee7945be8d03b6b3b032515b 5ba3037287524d6384ca96ffe58798fa
#: 9635f37d34e04764855f21d2266411f6
msgid "or"
msgstr "或者"
#: ../../getting_started/faq/deploy/deploy_faq.md:27
#: 0899f0e28dae443b8f912d96c797b79c
#: c1c71ca902d745b89136bb63beda3dfd
msgid ""
"Q2: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to"
" open database file"
@ -55,80 +57,80 @@ msgstr ""
" open database file"
#: ../../getting_started/faq/deploy/deploy_faq.md:29
#: 3e60d8190e49436b8c40b34a67b7bfb3
#: 97124a4512534c63bd09f2cf5a76fd13
msgid "make sure you pull latest code or create directory with mkdir pilot/data"
msgstr "make sure you pull latest code or create directory with mkdir pilot/data"
#: ../../getting_started/faq/deploy/deploy_faq.md:31
#: baeaae20238842d3b8e4ae5b337198e5
#: 369ed2cd489d46009184036a8f8ed67a
msgid "Q3: The model keeps getting killed."
msgstr "Q3: The model keeps getting killed."
#: ../../getting_started/faq/deploy/deploy_faq.md:33
#: eb3936307ad64b19b73483ff9ae126f2
#: 6d59ca711a95495d9bddf22cd804e20b
msgid ""
"your GPU VRAM size is not enough, try replace your hardware or replace "
"other llms."
msgstr "GPU显存不够, 增加显存或者换一个显存小的模型"
#: ../../getting_started/faq/deploy/deploy_faq.md:35
#: f6dba770717041699c73b4cd00d48aad
#: 7ef755bf77fa46ccb63076c3561ecc64
msgid "Q4: How to access website on the public network"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:37
#: 447d9e9374de44bab6d8a03f2c936676
#: cd3f9144525b49babb826a7447812016
msgid ""
"You can try to use gradio's [network](https://github.com/gradio-"
"app/gradio/blob/main/gradio/networking.py) to achieve."
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:48
#: 5e34dd4dfcf34feeb1815dfa974041d0
#: 71f0174d58674b1abd3d6a02cf65abf6
msgid "Open `url` with your browser to see the website."
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:50
#: aaef774ce6124021a3862bc0a25d465f
#: 81b07e64feef4187beab2022f3af294d
msgid "Q5: (Windows) execute `pip install -e .` error"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:52
#: ec3945df451c4ec2b32ebb476f45c82b
#: f2e7cd453c10486aa9b7d90d1d771b58
msgid "The error log like the following:"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:71
#: 1df09f6d9f9b4c1a8a32d6e271e5ee39
#: 2c97bbe2f96142ec8398b376f6a21d7f
msgid ""
"Download and install `Microsoft C++ Build Tools` from [visual-cpp-build-"
"tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:75
#: 251f47bfa5694242a1c9d81a2022b7a0
#: 95120da5a6bf4a26bf64c2dd54632e4b
msgid "Q6: `Torch not compiled with CUDA enabled`"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:82
#: bc9dfdfc47924a0e8d3ec535e23bf923
#: fa936391d8bd44cebeffc92e0f893700
msgid "Install [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit-archive)"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:83
#: b5a632baa42745bdbee5d6ba516d8d8b
#: a8eb968b4b5a4f2786f7133299b8d20f
msgid ""
"Reinstall PyTorch [start-locally](https://pytorch.org/get-started/locally"
"/#start-locally) with CUDA support."
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:85
#: 0092fb91642749f5a55b629017c0de6a
#: 009f8b213c9044888975f1ae8cdf7a75
msgid "Q7: ImportError: cannot import name 'PersistentClient' from 'chromadb'."
msgstr "Q7: ImportError: cannot import name 'PersistentClient' from 'chromadb'."
#: ../../getting_started/faq/deploy/deploy_faq.md:91
#: 4aa87418f2a54c138bf3b7ff28a7e776
#: 237706fe28b846dcbe77e04a3bf89a6c
msgid ""
"Q8: pydantic.error_wrappers.ValidationError:1 validation error for "
"HuggingFaceEmbeddings.model_kwargs extra not permitted"
@ -137,15 +139,63 @@ msgstr ""
"HuggingFaceEmbeddings.model_kwargs extra not permitted"
#: ../../getting_started/faq/deploy/deploy_faq.md:102
#: 6b690ab272af44f6b126cfe5ce1435ef
#: e20c5fde988b478fb7eaba0f10d7d196
msgid "Q9: alembic.util.exc.CommandError: Target database is not up to date."
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:103
#: 223026d3b9124363b695937922d8f8d5
#: ../../getting_started/faq/deploy/deploy_faq.md:104
#: 6d096ff6f4754490868a0ff2b8a08f10
msgid "delete files in `DB-GPT/pilot/meta_data/alembic/versions/` and restart."
msgstr "删除`DB-GPT/pilot/meta_data/alembic/versions/`目录下文件然后重新启动"
#: ../../getting_started/faq/deploy/deploy_faq.md:110
#: 2294a811682d4744b9334ee6deec4a49
msgid "Q10: How to store DB-GPT metadata into my database"
msgstr "Q10: 如何将 DB-GPT 的元数据存储到自己的数据库中"
#: ../../getting_started/faq/deploy/deploy_faq.md:112
#: 034495af54f041bcb560a5366b9be912
msgid ""
"In version 0.4.0, the metadata module of the DB-GPT application has been "
"refactored. All metadata tables will now be automatically saved in the "
"'dbgpt' database, based on the database type specified in the `.env` "
"file. If you would like to retain the existing data, it is recommended to"
" use a data migration tool to transfer the database table information to "
"the 'dbgpt' database. Additionally, you can change the default database "
"name 'dbgpt' in your `.env` file."
msgstr ""
"v0.4.0 重构了DB-"
"GPT应用的数据库元数据模块所有的元数据库表都会自动保存在.env文件设置的数据库类型的`dbgpt`数据库中如果想沿用以前的数据建议使用数据迁移工具将数据库表信息挪到dbgpt数据库中。"
"另外,你可以在 `.env` 中修改默认的数据库名 'dbgpt' "
#: ../../getting_started/faq/deploy/deploy_faq.md:132
#: f9baf853f21b460ba5df63b84b35c040
msgid ""
"Q11: pymysql.err.OperationalError: (1142, \"ALTER command denied to user "
"'{you db user}'@'{you db host}' for table '{some table name}'\")"
msgstr ""
#: ../../getting_started/faq/deploy/deploy_faq.md:134
#: a64cb2d75d6643559420c016362eb435
msgid ""
"In version 0.4.0, DB-GPT use migration tool alembic to migrate metadata. "
"If the database user does not have DDL permissions, this error will be "
"reported. You can solve this problem by importing the metadata "
"information separately."
msgstr ""
"v0.4.0后DB-GPT 使用 alembic 作为元数据迁移工具。"
"如果数据库用户没有 DDL 权限则会报这个错,您可以通过单独导入元数据信息来解决这个问题。"
#: ../../getting_started/faq/deploy/deploy_faq.md:136
#: 77c6bd4b559d457ab599b7f7730e85f1
msgid "Use a privileged user to execute DDL sql file"
msgstr "使用一个有权限的用户来执行 DDL SQL 文件。"
#: ../../getting_started/faq/deploy/deploy_faq.md:141
#: 30c3fd7f7bfc4a63b5b9c4c15c64430f
msgid "Run DB-GPT webserver with `--disable_alembic_upgrade`"
msgstr "添加参数 `--disable_alembic_upgrade` 来运行 DB-GPT 的 webserver"
#~ msgid ""
#~ "Q2: When use Mysql, Access denied "
#~ "for user 'root@localhost'(using password :NO)"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-20 14:49+0800\n"
"POT-Creation-Date: 2023-10-27 15:57+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
@ -20,34 +20,34 @@ msgstr ""
"Generated-By: Babel 2.12.1\n"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:1
#: e95c136d802f486082c47a8c017eb725
#: ab7d87ee62774af099fb0a8167b2d4be
msgid "KBQA FAQ"
msgstr "KBQA FAQ"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:4
#: f19c96b7b1ec4bc7ad8c7c26582d7e59
#: 3582be98154f4c3381765c130538d997
msgid "Q1: text2vec-large-chinese not found"
msgstr "Q1: text2vec-large-chinese not found"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:6
#: 24a0603be39d4418909c27f9a53b51e2
#: 3382fb6d60b443029a04e183cb5449cf
msgid ""
"make sure you have download text2vec-large-chinese embedding model in "
"right way"
msgstr "确认下载text2vec-large-chinese模型姿势以及路径正确"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:18
#: 356008dd415f4bdd9b0927d8ee073548
#: 9fb65568d9cb4bf0be9371eae38ffe75
msgid "Q2:How to change Vector DB Type in DB-GPT."
msgstr "怎么修改向量数据库类型"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:20
#: 42013bfb02624010b668bd244b33c977
#: 1904c691985044acad9d1cd84a227250
msgid "Update .env file and set VECTOR_STORE_TYPE."
msgstr "怎样在.env文件设置VECTOR_STORE_TYPE"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:22
#: 72b2bae15fea4e0d927bda68a8d0861d
#: a6ebd5b32fac42fbbdb7e26aaeafd781
msgid ""
"DB-GPT currently support Chroma(Default), Milvus(>2.1), Weaviate vector "
"database. If you want to change vector db, Update your .env, set your "
@ -61,19 +61,19 @@ msgstr ""
"://db-gpt.readthedocs.io/en/latest/modules/vector.html)"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:38
#: 0a12e3a5319c4a86a1db68d615d6fb8e
#: 8357695648cf4dcca7d8d2c6d0c48b0a
msgid "Q3:When I use vicuna-13b, found some illegal character like this."
msgstr "当使用vicuna系列模型时出现乱码。"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:43
#: f89ffbf4697a4ccdb8030834c52b0473
#: ff8cb9ecfd2d4c9fa179b872d03a97dd
msgid ""
"Set KNOWLEDGE_SEARCH_TOP_SIZE smaller or set KNOWLEDGE_CHUNK_SIZE "
"smaller, and reboot server."
msgstr "通过在.env文件将KNOWLEDGE_SEARCH_TOP_SIZE设置更小点或者在文档界面点击参数设置将topk设置更小点"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:45
#: fc837488bcc7432a92b70126e80e75d7
#: d7a49b1b219c4cf1bcb6ba212e378a7e
msgid ""
"Q4:space add error (pymysql.err.OperationalError) (1054, \"Unknown column"
" 'knowledge_space.context' in 'field list'\")"
@ -82,53 +82,58 @@ msgstr ""
"'knowledge_space.context' in 'field list'\")"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:47
#: 30c186bae2c3489eb18c18768c11c302
#: 30d34122c9fe4d1a9870c54480c734a6
msgid "1.shutdown dbgpt_server(ctrl c)"
msgstr "1.终止 dbgpt_server(ctrl c)"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:49
#: 9cac5688ddb14c63905cc86e77d4567e
#: 1ccc21a493114e399007f9399f98006b
msgid "2.add column context for table knowledge_space"
msgstr "2.新增列 `context` for table knowledge_space"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:55
#: b32219bc1c6246108f606952d8ef0132
#: 075c48b850354ac7971bd7556b68ef52
msgid "3.execute sql ddl"
msgstr "3.执行ddl"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:62
#: ebfd196350994c44841d5766f776905c
#: c4484fc646324c9a976b81a4e802c435
msgid "4.restart dbgpt serve"
msgstr "4.重启dbgpt server"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:64
#: cfa083226efd4980a57ff15e86bb8480
#: b3da50497f37421485d8f0e852f0b09c
msgid "Q5:Use Mysql, how to use DB-GPT KBQA"
msgstr "Q5:当使用 Mysql数据库时, 使用DB-GPT怎么初始化 KBQA service database schema"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:66
#: 95098205d36c4ca79ad9b1b0f9b2985a
#: 97484a97b0d14d3f835efb5a0739c97e
msgid "build Mysql KBQA system database schema."
msgstr "构建Mysql KBQA system database schema"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:73
#: efc87678042d48b38b57f700d9ff74e5
#: bdcbaf0559a549468fab021e03ac3876
msgid "Q6:when pull from 0.4.0, I found historical knowledge document disappeared"
msgstr "当从0.4.0版本拉取代码后,历史知识库问答信息没了"
#: ../../getting_started/faq/kbqa/kbqa_faq.md:75
#: 975eaff1a20a40b5b5ee18d6c6ddb9c1
#: ea78542f6be94dfc8d97b2660bb22876
#, fuzzy
msgid ""
"In version 0.4.0, the metadata module of the DB-GPT application has been "
"refactored. All metadata tables will now be automatically saved in the "
"'dbgpt' database, based on the database type specified in the .env file. "
"If you would like to retain the existing data, it is recommended to use a"
" data migration tool to transfer the database table information to the "
"'dbgpt' database."
msgstr "v0.4.0 重构了DB-GPT应用的数据库元数据模块所有的元数据库表都会自动保存在.env文件设置的数据库类型的`dbgpt`数据库中如果想沿用以前的数据建议使用数据迁移工具将数据库表信息挪到dbgpt数据库中。"
"'dbgpt' database, based on the database type specified in the `.env` "
"file. If you would like to retain the existing data, it is recommended to"
" use a data migration tool to transfer the database table information to "
"the 'dbgpt' database. Additionally, you can change the default database "
"name 'dbgpt' in your `.env` file."
msgstr ""
"v0.4.0 重构了DB-"
"GPT应用的数据库元数据模块所有的元数据库表都会自动保存在.env文件设置的数据库类型的`dbgpt`数据库中如果想沿用以前的数据建议使用数据迁移工具将数据库表信息挪到dbgpt数据库中。"
"另外,你可以在 `.env` 中修改默认的数据库名 'dbgpt' "
#: ../../getting_started/faq/kbqa/kbqa_faq.md:78
#: 815e44fef54f4807a2cf1e8d64b73a70
#: badc49ae6b4340be9700b92b1023e45b
msgid "old database:knowledge_management; new database:dbgpt;"
msgstr ""