Skip to content

Commit

Permalink
[Docs] call set_adapters() after add_weighted_adapter (#1444)
Browse files Browse the repository at this point in the history
  • Loading branch information
sayakpaul authored Feb 7, 2024
1 parent fc78a24 commit 17273aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/source/developer_guides/lora.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,15 @@ model = PeftModel.from_pretrained(base_model, peft_model_id, adapter_name="sft")
Then load a different adapter and merge it with the first one:

```python
weighted_adapter_name = "sft-dpo"
model.load_adapter("alignment-handbook/zephyr-7b-dpo-lora", adapter_name="dpo")
model.add_weighted_adapter(
adapters=["sft", "dpo"],
weights=[0.7, 0.3],
adapter_name="sft-dpo",
adapter_name=weighted_adapter_name,
combination_type="linear"
)
model.set_adapter(weighted_adapter_name)
```

<Tip>
Expand Down

0 comments on commit 17273aa

Please sign in to comment.