Errors When Editing Llama2 and gpt2-xl Using KN Method in easyedit
I encountered some issues while using the KN method to edit the Llama2 and gpt2-xl models based on the easyedit framework. Here is the code snippet:
editor = BaseEditor.from_hparams(hparams)
metrics, edited_model, _ = editor.edit_dataset(
edit_ds,
keep_original_weight=roll_back_weight
)
I faced the following problem:
Traceback (most recent call last):
File "/workspace/editing/edit-evaluation/edit.py", line 146, in <module>
main()
File "/workspace/editing/edit-evaluation/edit.py", line 130, in main
metrics, edited_model, _ = editor.edit_dataset(
File "/workspace/editingedit-evaluation/easyeditor/editors/editor.py", line 499, in edit_dataset
for k, v in weights_copy.items():
AttributeError: 'function' object has no attribute 'items'
We believe the issue originates from this line: (in easyeditor/model/kn_main.py, in function apply_kn_to_model )
return kn.model, unpatch_fn
Could you please advise on how to resolve this issue?
Thank you for your attention, we will trace the error and fix it soon.
Hello, the edit_dataset interface is now deprecated. You can use edit_requests (parameter as a dict) or edit (parameter as a query string) instead.
If all your issues have been resolved, please help close this issue.