# Facing error while adding multiple adapters to a model

**URL:** <https://discuss.huggingface.co/t/facing-error-while-adding-multiple-adapters-to-a-model/94873>\
**Category:** 🤗Transformers\
**Created:** [July 1, 2024, 7:18am UTC](https://discuss.huggingface.co/t/facing-error-while-adding-multiple-adapters-to-a-model/94873 "2024-07-01T07:18:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![InderV94](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@InderV94](https://discuss.huggingface.co/u/InderV94)\
**Post date:** [July 1, 2024, 7:18am UTC](https://discuss.huggingface.co/t/facing-error-while-adding-multiple-adapters-to-a-model/94873/1 "2024-07-01T07:18:12Z")

</div>

Hi Huggingfacers,

I have fine-tuned 4-bit quantized gemma-2b on some task. The finetuned model has **‘default’** PEFT/LORA adapter. I want to train this model further on some other task by adding one more adapter. I am loading this fine-tuned model as PEFT model using **AutoPeftModelForCausalLM** class. When trying to add adapter to the loaded model [`model.add_adapter(peft_config, adapter_name ="t2")`] , I am getting `TypeError: PeftModel.add_adapter() got multiple values for argument 'adapter_name'`

Has anyone tried training a base model for multiple tasks using PEFT?? If yes, please help!

---

<div class="post-metadata">

**Author:** ![HiDolen](https://avatars.discourse-cdn.com/v4/letter/h/848f3c/32.png) [@HiDolen](https://discuss.huggingface.co/u/HiDolen)\
**Post date:** [July 8, 2024, 12:15pm UTC](https://discuss.huggingface.co/t/facing-error-while-adding-multiple-adapters-to-a-model/94873/2 "2024-07-08T12:15:54Z")

</div>

> [@InderV94](#):
>
> I have fine-tuned 4-bit quantized gemma-2b on some task. The finetuned model has **‘default’** PEFT/LORA adapter. I want to train this model further on some other task by adding one more adapter. I am loading this fine-tuned model as PEFT model using **AutoPeftModelForCausalLM** class. When trying to add adapter to the loaded model [`model.add_adapter(peft_config, adapter_name ="t2")`] , I am getting `TypeError: PeftModel.add_adapter() got multiple values for argument 'adapter_name'`

The order of arguments in the `add_adapter` function is incorrect. You should provide `adapter_name` first and then `peft_config`. Try it:

```python
model.add_adapter(peft_config=peft_config, adapter_name="t2")

```
