zjunlp / EasyEdit

[知识编辑] [ACL 2024] An Easy-to-use Knowledge Editing Framework for LLMs.
https://zjunlp.github.io/project/KnowEdit
MIT License
1.63k stars 200 forks source link

Error in run_santinization_llama2.py with method "SERAC" #278

Closed Yofuria closed 1 month ago

Yofuria commented 1 month ago

Hello, when I run run_santinization_llama2.py with method "SERAC", I met an error in EasyEdit/easyeditor/trainer/utils.py. In line 147 "search = os.path.join(wd, d)", it seems that 'wd' is not defined, I want to know 'wd' refers to what?

Traceback (most recent call last): File "EasyEdit/examples/run_santinization_llama2.py", line 649, in exp.run() File "EasyEdit/examples/run_santinization_llama2.py", line 595, in run self.edit() File "EasyEdit/examples/run_santinization_llama2.py", line 578, in edit way[edit_method]() File "EasyEdit/examples/run_santinization_llama2.py", line 246, in _MEND_andSERAC trainer = EditTrainer( File "EasyEdit/easyeditor/trainer/EditTrainer.py", line 27, in __init__ super().__init_\(config, train_set, valset) File "EasyEdit/easyeditor/trainer/BaseTrainer.py", line 86, in __init_\ archive, config.archive = load_archive(str(config.archive)) File "EasyEdit/easyeditor/trainer/utils.py", line 147, in load_archive search = os.path.join(wd, d) NameError: name 'wd' is not defined. Did you mean: 'd'?

And another error in EasyEdit/easyeditor/trainer/EditTrainer.py. In line 188, self.val_set is defined as None, but the len() function is called on it.

Traceback (most recent call last): File "EasyEdit/examples/run_santinization_llama2.py", line 649, in exp.run() File "EasyEdit/examples/run_santinization_llama2.py", line 595, in run self.edit() File "EasyEdit/examples/run_santinization_llama2.py", line 578, in edit way[edit_method]() File "EasyEdit/examples/run_santinization_llama2.py", line 251, in _MEND_and_SERAC trainer.run() File "EasyEdit/easyeditor/trainer/BaseTrainer.py", line 204, in run val_info = self.validate(steps=self.config.val_steps) File "EasyEdit/easyeditor/trainer/EditTrainer.py", line 188, in validate if steps is None or steps > len(self.val_set): TypeError: object of type 'NoneType' has no len()

MikeDean2367 commented 1 month ago

Hi, we have fixed this bug. Feel free to reach out if you have any further inquiries :)

zxlzr commented 1 month ago

Hi, do you have any further issues?