基础作业
- 使用 OpenCompass 评测 InternLM2-Chat-7B 模型在 C-Eval 数据集上的性能
安装
面向GPU的环境安装
1 2 3 4 5 6
| conda create --name opencompass --clone=/root/share/conda_envs/internlm-base source activate opencompass git clone https://github.com/open-compass/opencompass cd opencompass pip install -e .
|
数据准备
1 2 3
| cp /share/temp/datasets/OpenCompassData-core-20231110.zip /root/opencompass/ unzip OpenCompassData-core-20231110.zip
|
查看支持的数据集和模型
1 2
| python tools/list_configs.py internlm ceval
|

启动评测
1
| 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
|
命令解析
1 2 3 4 5 6 7 8 9 10
| --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 device_map='auto' trust_remote_code=True \ --max-seq-len 2048 \ --max-out-len 16 \ --batch-size 2 \ --num-gpus 1 --debug
|
显示 “Starting inference process”:
1
| [2024-02-21 18:35:54,756] [opencompass.openicl.icl_inferencer.icl_gen_inferencer] [INFO] Starting inference process...
|

评测完成后,将会看到:
