Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors When Editing Llama2 and gpt2-xl Using KN Method in easyedit #230

Open
1010648766 opened this issue Apr 17, 2024 · 1 comment
Open
Labels
question Further information is requested

Comments

@1010648766
Copy link

1010648766 commented Apr 17, 2024

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?

@zxlzr zxlzr added the question Further information is requested label Apr 17, 2024
@littlefive5
Copy link
Collaborator

Thank you for your attention, we will trace the error and fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants