# Blip2 peft training

**URL:** <https://discuss.huggingface.co/t/blip2-peft-training/138712>\
**Category:** Intermediate\
**Created:** [February 3, 2025, 10:40am UTC](https://discuss.huggingface.co/t/blip2-peft-training/138712 "2025-02-03T10:40:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aranganvaasi](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@aranganvaasi](https://discuss.huggingface.co/u/aranganvaasi)\
**Post date:** [February 3, 2025, 10:40am UTC](https://discuss.huggingface.co/t/blip2-peft-training/138712/1 "2025-02-03T10:40:15Z")

</div>

i am facing the error while i am trying to train the blip2 condition generation for question answer purpose

the error is : TypeError: Blip2ForConditionalGeneration.forward() got an unexpected keyword argument ‘inputs\_embeds’

i am passing only input\_ids,pixel\_value,attention\_mask,lables only

---

<div class="post-metadata">

**Author:** ![Alanturner2](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/alanturner2/32/37542_2.png) [@Alanturner2](https://discuss.huggingface.co/u/Alanturner2)\
**Post date:** [February 3, 2025, 1:12pm UTC](https://discuss.huggingface.co/t/blip2-peft-training/138712/2 "2025-02-03T13:12:11Z")

</div>

Hi there!  
It looks like `Blip2ForConditionalGeneration` doesn’t expect `inputs_embeds` as an argument in the `forward()` function, which is causing the error. Since you mentioned you’re only passing `input_ids`, `pixel_values`, `attention_mask`, and `labels`,

**Check the model’s documentation** – Some models expect specific arguments. Try running:

```python
from transformers import Blip2ForConditionalGeneration  
model = Blip2ForConditionalGeneration.from_pretrained("your_model_name")  
print(model.forward. __doc__ )  

```

This will show what arguments the `forward()` method accepts.  
Hope this help!

---

<div class="post-metadata">

**Author:** ![yeokeat](https://avatars.discourse-cdn.com/v4/letter/y/e480ec/32.png) [@yeokeat](https://discuss.huggingface.co/u/yeokeat)\
**Post date:** [May 9, 2025, 6:25am UTC](https://discuss.huggingface.co/t/blip2-peft-training/138712/3 "2025-05-09T06:25:09Z")

</div>

Hi @aranganvaasi , I have also encounter same error, did you manage to solve this error? possible to share with us? thank you!
