DB-GPT 安装

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

参考官网:
https://docs.dbgpt.site/docs/latest/quickstart
安装文档 - 选择 安装部署 -> 源码部署
使用文档 · 语雀

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

下载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_env3114 python=3.11.4
conda activate dbgpt_env3114

python --version

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

下载git代码,通常不需要科学

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

cd /data/DB-GPT/


cd /data/DB-GPT/

pip install -e ".[default]" --proxy http://myproxy:8086

提示:
Running setup.py develop for dbgpt
很快完成

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

# 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

cd DB-GPT
mkdir models and cd models
cd models
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

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

启动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
========================================

vi /lib/systemd/system/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
 

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


报错:
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

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

报错:缺python库

conda install pytorch
conda install fastapi
conda install python-dotenv
conda install cachetools

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值