| github |
Chat2Anything is a large model (LLM) knowledge base question and answer system for enterprise internal environments. It has the following functions:
It includes the client (Chat2Anything) and the backend management system (Chat2Anything Admin). The backend management system is responsible for the creation and management of the large model knowledge base. Users can add corporate internal knowledge (Langchain mechanism) to the large model by uploading Excel, Word, PDF and other files. ); the management system includes complete user permissions, roles, organizations, data dictionary management and other functions
Supports mainstream large models such as ChatGPT, ChatGLM, and Vicuna. Users can switch large models at any time; when using ChatGLM and Vicuna, the entire system can achieve complete private domain deployment, and 100% internal circulation of enterprise data
Supports business system database access, manual/automatic selection of tables involved in query analysis, and text2SQL based on user problem descriptions (to be improved), and query results are automatically executed and visualized (to be developed)
Locally configure ChatGLM (https://github.com/THUDM/ChatGLM-6B) / Vicuna (https://github.com/lm-sys/FastChat) and other large models, such as using ChatGPT, in Chat2Anything/configs/openai_config. Configure OPENAI_API_KEY and OPENAI_API_BASE in the py file
Run controller:
python3 -m fastchat.serve.controller
Run model_worker (ChatGLM-6B, ChatGLM2-6B recommended (https://github.com/THUDM/ChatGLM2-6B)):
python3 -m fastchat.serve.model_worker_chatglm --model-path /path/to/model/weights
or
Run model_worker (vicuna):
python3 -m fastchat.serve.model_worker --model-path /path/to/model/weights
Run client web server
python3 -m fastchat.serve.chat2anything_web_server
If using ChatGPT, add the startup parameter --add-chatgpt
Basic test environment
Ubuntu 20.04 CUDA 11.7 Python 3.9 PyTorch 1.13
Tesla V100 32GB * 1
Database (MySQL) configuration:
# MySql配置信息
MYSQL_HOST =数据库地址
MYSQL_PORT =数据库端口
MYSQL_DATABASE = chat2anything_db
MYSQL_USERNAME =账户
MYSQL_PASSWORD =密码
# 密钥配置
SECRET_KEY = '一定要改'
Model related configuration:
# model_config.py
embedding_model_dict = {
'text2vec": "/Path/to/text2vec-large-chinese' ,
}
# 密钥配置
VECTOR_ROOT_PATH = os . path . join ( '/Path/to/Chat2Anything' , 'vector_stores' )
Database initialization:
flask db init
flask db migrate
flask db upgrade
flask admin init
run:
# Windows
run.bat
# Linux
chmod +x run.sh
./run.sh
# 管理员默写账户密码
admin 123456
Appreciate the following contributions: