README.md 1.79 KB
Newer Older
chenych's avatar
chenych committed
1
# chat_demo
Rayyyyy's avatar
Rayyyyy committed
2
技服智能问答服务
chenych's avatar
chenych committed
3

Rayyyyy's avatar
Rayyyyy committed
4
5
6
7
## 环境配置
### Docker(方式一)
-v 路径、docker_name和imageID根据实际情况修改
```bash
Rayyyyy's avatar
update  
Rayyyyy committed
8
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-centos7.6-dtk24.04-py310
Rayyyyy's avatar
Rayyyyy committed
9
10
docker run -it -v /path/your_code_data/:/path/your_code_data/ --shm-size=80G --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name docker_name imageID bash
# 加载运行环境变量
Rayyyyy's avatar
update  
Rayyyyy committed
11
12
unzip dtk-cuda.zip
mv ./cuda /opt/dtk/
Rayyyyy's avatar
Rayyyyy committed
13
14
15
16
17
18
19
20
21
22
23
24
25
source /opt/dtk/cuda/env.sh
# 下载fastllm库
git clone http://developer.hpccube.com/codes/OpenDAS/fastllm.git
# 编译fastllm
cd fastllm
mkdir build
cd build
cmake ..
make -j
# 编译完成后,可以使用如下命令安装简易python工具包
cd tools # 这时在fastllm/build/tools目录下
python setup.py install

Rayyyyy's avatar
update  
Rayyyyy committed
26
27
28
cd /path/of/chat_demo
pip install faiss-1.7.2_dtk24.04_gitb7348e7df780-py3-none-any.whl
pip install -r requirements.txt
Rayyyyy's avatar
Rayyyyy committed
29
30
31
32
```

### Dockerfile(方式二)
```
Rayyyyy's avatar
update  
Rayyyyy committed
33
34
35
docker build -t chat_demo:latest .
docker run -dit --network=host --name=chat_demo --privileged --device=/dev/kfd --device=/dev/dri --ipc=host --shm-size=16G  --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root --ulimit stack=-1:-1 --ulimit memlock=-1:-1 chat_demo:latest
docker exec -it chat_demo /bin/bash
Rayyyyy's avatar
Rayyyyy committed
36

Rayyyyy's avatar
update  
Rayyyyy committed
37
# 其他步骤同上面的Docker(方式一)
Rayyyyy's avatar
Rayyyyy committed
38
39
```

Rayyyyy's avatar
update  
Rayyyyy committed
40
41
### Conda(方法三)
关于本项目DCU显卡所需的工具包、深度学习库等均可从[光合](https://developer.hpccube.com/tool/)开发者社区下载安装。
Rayyyyy's avatar
Rayyyyy committed
42

Rayyyyy's avatar
update  
Rayyyyy committed
43
44
45
46
47
48
```bash
DTK驱动: dtk24.04
python: python3.10
torch: 2.1.0
```
`Tips:以上dtk驱动、python、deepspeed等工具版本需要严格一一对应。`
Rayyyyy's avatar
Rayyyyy committed
49
50
51

3. 其它依赖库参照requirements.txt安装:
```
Rayyyyy's avatar
update  
Rayyyyy committed
52
pip install faiss-1.7.2_dtk24.04_gitb7348e7df780-py3-none-any.whl
Rayyyyy's avatar
Rayyyyy committed
53
54
pip install -r requirements.txt
```