DB-GPT 安装

从源代码开始安装,因为docker镜像库不能用了。。。

参考官网:

https://docs.dbgpt.site/docs/latest/quickstart

安装文档 - source

https://docs.dbgpt.site/docs/latest/installation/sourcecode

下载源代码

Download DB-GPT

git clone https://github.com/eosphoros-ai/DB-GPT.git

报错

remote: Counting objects: 100% (208/208), done.

remote: Compressing objects: 100% (175/175), done.

error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.

error: 57342 bytes of body are still expected

fetch-pack: unexpected disconnect while reading sideband packet

fatal: early EOF

fatal: fetch-pack: invalid index-pack output

奇怪 ,貌似我的这个Ubuntu有问题,不深究,从别的Ubuntu系统下载,然后拷贝过去

tar -zcvf DB-GPT.tgz DB-GPT/

scp DB-GPT.tgz root@192.168.254.194:/data/

下载minoconda和python

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

chmod +x Miniconda3-latest-Linux-x86_64.sh

./Miniconda3-latest-Linux-x86_64.sh

You can undo this by running `conda init --reverse $SHELL`? yes\|no

no >>>

这里要选yes

source ~/.bashrc

注意:

Do you wish to update your shell profile to automatically initialize conda?

This will activate conda on startup and change the command prompt when activated.

If you'd prefer that conda's base environment not be activated on startup,

run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running `conda init --reverse $SHELL`

conda create -n dbgpt_env python=3.10

conda activate dbgpt_env

cd /data/DB-GPT/

conda install pytorch

conda install fastapi

conda install python-dotenv

conda install cachetools

cd /data/DB-GPT/

pip install -e ".default"

提示:

Running setup.py develop for dbgpt

很快完成

sudo yum install qemu-kvm libvirt libvirt-devel libguestfs-tools virt-install bridge-utils

sudo systemctl start libvirtd

sudo systemctl enable libvirtd

sudo yum install virt-manager

conda install pytorch

报错:

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken

by 'ReadTimeoutError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Read timed out. (read timeout=9.15)")': /pkgs/main/linux-64/gmpy2-2.1.2-py310heeb90bb_0.conda

解决办法:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config --set show_channel_urls yes

pip install -e ".default"

报错:

Downloading nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl (731.7 MB)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━ 622.3/731.7 MB 489.4 kB/s eta 0:03:44

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

网络问题,后面加个参数proxy配置即可

复制代码
pip install -e ".[default]" --proxy http://myproxy:8086

export PYTHONPATH=/data/DB-GPT

export PYTHONPATH=/data/DB-GPT

models

需要下载

cd DB-GPT

mkdir models and cd models

Add the Git LFS package repository

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash

Update your package lists

sudo apt-get update

Install Git LFS

sudo apt install git-lfs

embedding model

git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese

also you can use m3e-large model, you can choose one of them according to your needs

git clone https://huggingface.co/moka-ai/m3e-large

LLM model, if you use openai or Azure or tongyi llm api service, you don't need to download llm model

git clone https://huggingface.co/THUDM/glm-4-9b-chat

apt install rar

rar a -v500m models.rar models/*

scp models.part00*.rar root@192.168.254.194:/data/DB-GPT/

scp root@172.21.254.215:/mnt/bigstore/nfs_zstack/upload_zstack/temp/dbgpt.models/*.rar

环境说明:

model_name: glm-4-9b-chat

model_path: /data/DB-GPT/models/glm-4-9b-chat

========================================

启动DB-GPT的脚本

startDB-GPT.sh

#!/bin/sh

conda activate dbgpt_env

cd /data/DB-GPT

/data/miniconda3/envs/dbgpt_env/bin/python dbgpt/app/dbgpt_server.py

========================================

db-gpt.service

Unit

Description=My Conda Script Service DB-GPT

After=network.target

Service

Type=onshot

#simple

ExecStart=/data/startDB-GPT.sh

Restart=on-failure

User=root

Environment="PATH=/usr/bin:/data/miniconda3/condabin:$PATH"

WorkingDirectory=/data/DB-GPT

Environment="CONDA_DEFAULT_ENV=dbgpt_env"

StandardOutput=journal

StandardError=file://data/DB-GPT/error.log

Environment="CONDA_EXE=/data/miniconda3/bin/conda"

Environment="CONDA_PREFIX=/data/miniconda3/envs/dbgpt_env"

Environment="CONDA_PREFIX_1=/data/miniconda3"

Environment="CONDA_PROMPT_MODIFIER='(dbgpt_env) '"

Environment="CONDA_PYTHON_EXE=/data/miniconda3/bin/python"

Install

WantedBy=multi-user.target

相关推荐
笃行35044 分钟前
别拿MySQL数据库管理工具硬导:MySQL 迁 KingbaseES 的完整工具链
数据库
风哥2号1 小时前
数据库教程FGMT51‑PostgreSQL实例管理与参数文件
数据库·postgresql
蓝速科技1 小时前
桌面双屏翻译机量产调试:三类场景兼容性破局方案丨蓝速科技
运维·数据库·人工智能·科技·技术分享
达梦数据2 小时前
DMDRS空间数据类型说明:Oracle、DM8、MySQL空间数据类型映射
数据库·mysql·oracle
白远山2 小时前
24小时自助健身房系统开发实战:从需求分析到完整指南
java·开发语言·数据库·数据挖掘·需求分析
达梦数据2 小时前
DMDRS服务与模块的运行步骤
数据库
让学习成为一种生活方式3 小时前
PMGD:植物线粒体基因组数据库--Journal of Integrative Plant Biology
数据库
达梦数据3 小时前
达梦数据复制软件DMDRS搭建部署示例:源数据库DM8到目标数据库DM8一对一数据同步
数据库
IT_Octopus4 小时前
从一个应用开发者的角度,搞懂大数据查询的完整链路
java·大数据·数据库
Htr_4 小时前
Creem 2.0 使用指南:面向 AI 构建时代的资金平台
android·数据库·人工智能·ui·photoshop