- At least one A100/A800 80G GPU and another GPU with no less than 24G memory.
- Environment
conda create -n pmet python=3.10 pip install -r requirements.txt
python evaluate.py --model_path [your model path] --model_name EleutherAI/gpt-j-6B --alg_name PMET --hparams_fname EleutherAI_gpt-j-6B.json --ds_name mcf --num_edits [num]
Computing
python summarize.py --dir_name=PMET --runs=run_<run1>,run_<run2>
python evaluate.py --model_path [your model path] --model_name EleutherAI/gpt-j-6B --hparams_fname EleutherAI_gpt-j-6B-zsre.json --ds_name zsre --num_edits [num]
Our code is based on MEMIT
.
Xiaopeng Li, Shasha Li, Shezheng Song, Jing Yang, Jun Ma, Jie Yu. PMET: Precise Model Editing in a Transformer. arXiv preprint arXiv:2308.08742 (2023).
@article{li2023pmet,
title={PMET: Precise Model Editing in a Transformer},
author={Li, Xiaopeng and Li, Shasha and Song, Shezheng and Yang, Jing and Ma, Jun and Yu, Jie},
journal={arXiv preprint arXiv:2308.08742},
year={2023}
}