过程记录
bash
conda create --name opencompass --clone=/root/share/conda_envs/internlm-base
conda activate opencompass
git clone https://github.com/open-compass/opencompass
cd opencompass
pip install -e .
# 解压评测数据集到 data/ 处
cp /share/temp/datasets/OpenCompassData-core-20231110.zip /root/opencompass/
unzip OpenCompassData-core-20231110.zip
# 将会在opencompass下看到data文件夹
# 列出所有跟 internlm 及 ceval 相关的配置
python tools/list_configs.py internlm ceval
python run.py --datasets ceval_gen --hf-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-kwargs padding_side='left' truncation='left' trust_remote_code=True --model-kwargs trust_remote_code=True device_map='auto' --max-seq-len 2048 --max-out-len 16 --batch-size 4 --num-gpus 1 --debug
# 命令参数解释
# --datasets ceval_gen \
# --hf-path /share/temp/model_repos/internlm-chat-7b/ \ # HuggingFace 模型路径
# --tokenizer-path /share/temp/model_repos/internlm-chat-7b/ \ # HuggingFace tokenizer 路径(如果与模型路径相同,可以省略)
# --tokenizer-kwargs padding_side='left' truncation='left' trust_remote_code=True \ # 构建 tokenizer 的参数
# --model-kwargs device_map='auto' trust_remote_code=True \ # 构建模型的参数
# --max-seq-len 2048 \ # 模型可以接受的最大序列长度
# --max-out-len 16 \ # 生成的最大 token 数
# --batch-size 2 \ # 批量大小
# --num-gpus 1 # 运行模型所需的 GPU 数量
效果截图