zjunlp / EasyEdit

[ACL 2024] An Easy-to-use Knowledge Editing Framework for LLMs.
https://zjunlp.github.io/project/KnowEdit
MIT License
1.74k stars 210 forks source link

运行BLIP2拨错TypeError: forward() got an unexpected keyword argument 'input_ids' #262

Closed tobocca closed 3 months ago

tobocca commented 3 months ago

代码如下: from easyeditor import EditTrainer, MENDTrainingHparams, ZsreDataset,MENDMultimodalTrainingHparams,CounterFactDataset

training_hparams = MENDMultimodalTrainingHparams.from_hparams('hparams/TRAINING/MEND/blip2.yaml') train_ds = CounterFactDataset("./data/counterfact/counterfact-train.json", config=training_hparams) eval_ds = CounterFactDataset("./data/counterfact/counterfact-val.json", config=training_hparams) trainer = EditTrainer( config=training_hparams, train_set=train_ds, val_set=eval_ds ) trainer.run() 报错: image

tobocca commented 3 months ago

有遇到类似问题的吗

tbozhong commented 3 months ago

It appears that you are editing the model with mismatched dataset and trainer classes. Please refer to the Use EasyEdit section here for guidance on properly editing BLIP2.

zxlzr commented 3 months ago

Do you have any further issues?