Commit 6f267cd1 authored by Rayyyyy's avatar Rayyyyy
Browse files

Modify in README

parent 15d1457a
...@@ -133,7 +133,7 @@ torchrun --nproc_per_node 1 example_chat_completion.py \ ...@@ -133,7 +133,7 @@ torchrun --nproc_per_node 1 example_chat_completion.py \
--max_seq_len 512 --max_batch_size 6 --max_seq_len 512 --max_batch_size 6
``` ```
## 多轮对话 ### 多轮对话
1. 确认环境安装及模型下载完毕; 1. 确认环境安装及模型下载完毕;
2. 修改[chat.sh](./chat.sh)文件中的`--ckpt_dir``--tokenizer_path`参数为本地模型地址,`--max_seq_len`根据自身需求进行修改,调整该值可以增加多轮对话模型的记忆长度,不过需要注意的是这可能会增加模型运算的时间和内存需求; 2. 修改[chat.sh](./chat.sh)文件中的`--ckpt_dir``--tokenizer_path`参数为本地模型地址,`--max_seq_len`根据自身需求进行修改,调整该值可以增加多轮对话模型的记忆长度,不过需要注意的是这可能会增加模型运算的时间和内存需求;
3. 执行: 3. 执行:
...@@ -141,12 +141,15 @@ torchrun --nproc_per_node 1 example_chat_completion.py \ ...@@ -141,12 +141,15 @@ torchrun --nproc_per_node 1 example_chat_completion.py \
bash chat.sh bash chat.sh
``` ```
## Evaluation ### 验证
1. 安装`llama-recipes``lm-eval` 1. 安装`llama-recipes``lm-eval`
```bash ```bash
# llama-recipes 下载 # llama-recipes 下载
git clone http://developer.hpccube.com/codes/chenych/llama-recipes.git git clone http://developer.hpccube.com/codes/chenych/llama-recipes.git
cd llama-recipes
# 移动exact_match.py文件
mv exact_match.py ~/.cache/huggingface/evaluate/downloads/ mv exact_match.py ~/.cache/huggingface/evaluate/downloads/
cd ../
# lm-eval 下载 # lm-eval 下载
git clone http://developer.hpccube.com/codes/chenych/lm-evaluation-harness.git git clone http://developer.hpccube.com/codes/chenych/lm-evaluation-harness.git
cd ./lm-evaluation-harness/ cd ./lm-evaluation-harness/
...@@ -156,7 +159,9 @@ pip install -e . ...@@ -156,7 +159,9 @@ pip install -e .
2. 修改待测模型**pretrained**参数地址,例如`/home/Meta-Llama-3-8B-Instruct`,特别地,当前仅支持`hellaswag`数据集进行测试验证。执行以下命令: 2. 修改待测模型**pretrained**参数地址,例如`/home/Meta-Llama-3-8B-Instruct`,特别地,当前仅支持`hellaswag`数据集进行测试验证。执行以下命令:
```bash ```bash
cd /path_of/llama-recipes/recipes/evaluation cd /path_of/llama-recipes/recipes/evaluation
# 必须添加HF_ENDPOINT环境变量
export HF_ENDPOINT=https://hf-mirror.com export HF_ENDPOINT=https://hf-mirror.com
# 执行
python eval.py --model hf --model_args pretrained=/home/llama3/Meta-Llama-3-8B-Instruct,dtype="float" --tasks hellaswag --device cuda --batch_size 8 python eval.py --model hf --model_args pretrained=/home/llama3/Meta-Llama-3-8B-Instruct,dtype="float" --tasks hellaswag --device cuda --batch_size 8
``` ```
<div align=center> <div align=center>
......
...@@ -5,6 +5,6 @@ modelName=llama3_pytorch ...@@ -5,6 +5,6 @@ modelName=llama3_pytorch
# 模型描述 # 模型描述
modelDescription=Meta最新开源模型llama3 modelDescription=Meta最新开源模型llama3
# 应用场景 # 应用场景
appScenario=推理,对话问答,制造,广媒,家居,教育 appScenario=推理,训练,对话问答,制造,广媒,家居,教育
# 框架类型 # 框架类型
frameType=pytorch frameType=pytorch
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