【Llama2-Chinese】使用lm-evaluation-harness-master对中文LLM评测

一、下载评测工具lm-evaluation-harness-master

git clone https://github.com/EleutherAI/lm-evaluation-harness

git clone https://huggingface.co/datasets/ceval/ceval-exam/tree/main

获取评测工程及ceval-exam中文测试集保存至本地

二、工具及测试集拷贝至Llama2-Chinese的镜像内部

docker cp /root/lm-evaluation-harness container-id:/root/Llama2-Chinese/

路径如下图

三、lm-evaluation-harness-master对Ceval-exam测试集评估

CUDA_VISIBLE_DEVICES=1 python /root/lm-evaluation-harness-master/main.py --model hf --model_args pretrained=/root/Llama2-Chinese/Llama2-Chinese-7b-Chat --tasks Ceval-valid-accountant --output_base_path ./results/llama/ceval --write_out --output_path ./results/llama/ceval_result_5shot.json

3.1 报错raise ConnectionError(f"Couldn't reach '{path}' on the Hub ({type(e).__name__})")

原因:根据报错信息,由于访问外网失败获取不到指定数据集路径

解决:

1)根据提示修改/root/Llama2-Chinese/lm-evaluation-harness-master/lm_eval/base.py 第542行,由注释可知,设置测试集为镜像本地路径时,需要修改传参

def download(self, data_dir="/root/Llama2-Chinese/ceval-exam", cache_dir=None, download_mode=datasets.DownloadMode.REUSE_DATASET_IF_EXISTS):

2)修改/root/Llama2-Chinese/lm-evaluation-harness-master/lm_eval/tasks/ceval.py 第97行,设置dataset_path为测试集的绝对路径

至此3.1报错的获取本地数据集路径问题解决

3.2 报错raise DatasetGenerationError("An error occurred while generating the dataset") from e

解决中······

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
Llama2-7B是Llama2系列的一个版本,它是由Meta AI开发的一种大型语言模型。Llama2-7B有官方版本和Huggingface版本。官方版本包括Llama2-7B和Llama2-7B-Chat,而Huggingface版本包括Llama2-7B Huggingface版本和Llama2-7B-Chat Huggingface版本。 如果你想使用Llama2-7B来进行中文对话,可以访问https://huggingface.co/RicardoLee/Llama2-chat-Chinese-50W下载和使用Llama2-7B Huggingface版本。 需要注意的是,Llama2系列的模型在中文对话方面可能存在一些约束问题,根据一些用户的反馈,Llama2模型在中文对话的表现可能不如其他语言。所以在使用Llama2-7B进行中文对话时,可能会遇到一些限制或不理想的结果。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Llama2-7B/13B chat模型(下载地址).txt](https://download.csdn.net/download/u010291330/88215001)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [Llama2-chat-7B 开源中文版强势来袭!](https://blog.csdn.net/qq_27590277/article/details/131874933)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值