zjunlp / EasyEdit

[ACL 2024] An Easy-to-use Knowledge Editing Framework for LLMs.
https://zjunlp.github.io/project/KnowEdit
MIT License
1.88k stars 232 forks source link

一些关于KnowEditDataset类的疑问 #350

Closed Mint-hfut closed 2 months ago

Mint-hfut commented 2 months ago

当我运行 python run_knowedit_llama2.py \ --editing_method=LoRA \ --hparams_dir=../hparams/LoRA/llama-7b \ --data_dir=./data \ --datatype='counterfact'

之后,会出现报错:

Traceback (most recent call last): File "/root/EasyEdit/examples/run_knowedit_llama2.py", line 60, in datas = KnowEditDataset(args.data_dir,size=args.ds_size) File "/root/EasyEdit/examples/../easyeditor/dataset/knowedit.py", line 59, in init with open(zsre_loc, "r") as f: FileNotFoundError: [Errno 2] No such file or directory: 'data'

在run_knowedit_llama2.py第60行 :datas = KnowEditDataset(args.data_dir,size=args.ds_size),这里直接把顶级目录传入到了KnowEditDataset中了,而KnowEditDataset类会直接打开这个args.data_dir,造成报错。

如果我想手动输入数据的位置,我应该选择哪个数据集?是/data/KnowEdit/wiki_counterfact/test_cf.json还是/data/KnowEdit/wiki_counterfact/train_cf.json?

还有一个疑问,就是在KnowEditDataset里面有这样一行代码,zsre_loc = data_dir,这样写是数据只支持zsre数据吗?

littlefive5 commented 2 months ago
  1. 测试结果是/data/KnowEdit/wiki_counterfact/test_cf.json 数据集
  2. 这个代码是之前命名的问题,不是仅仅支持zsre,我们会进行修改。
Mint-hfut commented 2 months ago

明白了,谢谢

zxlzr commented 2 months ago

请问您还有其他问题吗