You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/root/xuetou/memit/experiments/py/demo.py", line 50, in demo_model_editing
model_new, orig_weights = apply_method(
^^^^^^^^^^^^^
File "/root/xuetou/memit/memit/memit_main.py", line 44, in apply_memit_to_model
deltas = execute_memit(model, tok, requests, hparams, cache_template=cache_template)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/xuetou/memit/memit/memit_main.py", line 101, in execute_memit
param = nethook.get_parameter(model, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/xuetou/memit/util/nethook.py", line 372, in get_parameter
raise LookupError(name)
LookupError: models.layers.3.mlp.gate_proj.weight
This should indicate a discrepancy between the layer name written in /root/xuetou/memit/hparams/MEMIT/my.json, and the actual name of the layer in the model. And this is my json:
There should not be any difference now, since I acutally printed out the name of each layer in my model, and checked each one carefully, but the problem still exists.
The text was updated successfully, but these errors were encountered:
I am trying to apply MEMIT to Qwen2.5-7B-Instruct-1M model, and there is a problem like this:
File "/root/xuetou/memit/experiments/py/demo.py", line 50, in demo_model_editing
model_new, orig_weights = apply_method(
^^^^^^^^^^^^^
File "/root/xuetou/memit/memit/memit_main.py", line 44, in apply_memit_to_model
deltas = execute_memit(model, tok, requests, hparams, cache_template=cache_template)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/xuetou/memit/memit/memit_main.py", line 101, in execute_memit
param = nethook.get_parameter(model, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/xuetou/memit/util/nethook.py", line 372, in get_parameter
raise LookupError(name)
LookupError: models.layers.3.mlp.gate_proj.weight
This should indicate a discrepancy between the layer name written in /root/xuetou/memit/hparams/MEMIT/my.json, and the actual name of the layer in the model. And this is my json:
{
"layers": [3, 4, 5, 6, 7],
"clamp_norm_factor": 0.75,
"layer_selection": "all",
"fact_token": "subject_last",
"v_num_grad_steps": 20,
"v_lr": 5e-1,
"v_loss_layer": 47,
"v_weight_decay": 0.5,
"kl_factor": 0.0625,
"mom2_adjustment": true,
"mom2_update_weight": 20000,
"rewrite_module_tmp": "models.layers.{}.mlp.gate_proj",
"layer_module_tmp": "model.layers.{}",
"mlp_module_tmp": "model.layers.{}.mlp",
"attn_module_tmp": "model.layers.{}.self_attn",
"ln_f_module": "model.norm",
"lm_head_module": "lm_head",
"mom2_dataset": "wikipedia",
"mom2_n_samples": 100000,
"mom2_dtype": "float32"
}
There should not be any difference now, since I acutally printed out the name of each layer in my model, and checked each one carefully, but the problem still exists.
The text was updated successfully, but these errors were encountered: