"docs/vscode:/vscode.git/clone" did not exist on "0f55643c59ec6236043cfb7a039d64fcdd4b4b73"
Commit c18e84b2 authored by chenych's avatar chenych
Browse files

Update README

parent 3f85ca43
......@@ -23,13 +23,11 @@ Gemma 2是由Google推出的一系列轻量级、最先进的开放模型,旨
Gemma 2 Instruct 已针对对话应用进行了优化,并使用监督微调 (SFT)、大模型蒸馏、人类反馈强化学习 (RLHF) 和模型合并 (WARP) 来提高整体性能。
## 环境配置
> Llama-Factory的安装方法请参考[README](https://developer.sourcefind.cn/codes/OpenDAS/llama-factory/-/blob/master/README.md)。
>
> -v 路径、docker_name和imageID根据实际情况修改。
### Docker(方法一)
```bash
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.2-py3.10
docker run -it -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/opt/hyhal/:ro --shm-size=80G --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name docker_name imageID bash
......@@ -40,7 +38,6 @@ pip install -r requirements.txt
Tips:以上dtk驱动、python、torch、vllm等DCU相关工具版本需要严格一一对应。
### Dockerfile(方法二)
```bash
docker build -t gemma2:latest .
docker run -it -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/opt/hyhal/:ro --shm-size=80G --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --name docker_name imageID bash
......@@ -50,7 +47,6 @@ pip install -r requirements.txt
```
### Anaconda(方法三)
关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.hpccube.com/tool/)开发者社区下载安装。
```
DTK驱动: dtk24.04.2
......@@ -58,7 +54,6 @@ python: 3.10
torch: 2.1.0
llama-factory: 0.8.3
transformers: >=4.41.2
vllm: 0.5.4
```
`Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应`
......@@ -81,7 +76,6 @@ pip uninstall flash_attn
```
### 单机单卡/单机多卡
1. 参考`gemma-2_pytorch/llama-factory-v0.8.3/examples``train_full``train_lora`中提供的gemma2样例,根据实际需求修改`model_name_or_path``dataset``learning_rate``cutoff_len`等参数,修改好的样例放入`llama-factory`框架的`examples`下的对应目录中即可。
```bash
# train_full 样例移动
......@@ -101,10 +95,9 @@ HIP_VISIBLE_DEVICES=0,1 FORCE_TORCHRUN=1 llamafactory-cli train examples/train_l
```
## 推理
使用`transformers`框架推理,vllm版本需>0.5.0
使用`transformers`框架推理。
### 单机单卡
```bash
# 指定卡号
export HIP_VISIBLE_DEVICES=0,1
......@@ -141,7 +134,6 @@ python inference.py --model_path /path/of/gemma2 --max_new_tokens xxx
`科研,教育,政府,金融`
## 预训练权重
[gemma-2-2b](http://113.200.138.88:18080/aimodels/gemma-2-2b)
[gemma-2-2b-it](http://113.200.138.88:18080/aimodels/gemma-2-2b-it)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment