"vscode:/vscode.git/clone" did not exist on "5942af978a8a8ff706a302b1ba2d9ef3ce144444"
README.md 1.78 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
unzip dtk-cuda.zip -d /opt/dtk/
Rayyyyy's avatar
Rayyyyy committed
12
13
14
15
16
17
18
19
20
21
22
23
24
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
25
26
27
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
28
29
30
31
```

### Dockerfile(方式二)
```
Rayyyyy's avatar
update  
Rayyyyy committed
32
33
34
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
35

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

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

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

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