Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PeftMixedModel example #1824

Closed
ringohoffman opened this issue Jun 4, 2024 · 2 comments · Fixed by #1850
Closed

Fix PeftMixedModel example #1824

ringohoffman opened this issue Jun 4, 2024 · 2 comments · Fixed by #1850

Comments

@ringohoffman
Copy link

Feature request

The PeftMixedModel docstring references get_peft_model and imports it in its example but doesn't use it:

Example:
```py
>>> from peft import get_peft_model
>>> base_model = ... # load the base model, e.g. from transformers
>>> peft_model = PeftMixedModel.from_pretrained(base_model, path_to_adapter1, "adapter1").eval()
>>> peft_model.load_adapter(path_to_adapter2, "adapter2")
>>> peft_model.set_adapter(["adapter1", "adapter2"]) # activate both adapters
>>> peft_model(data) # forward pass using both adapters
```

Motivation

The unused import in the docstring is confusing.

Your contribution

Yes.

@BenjaminBossan
Copy link
Member

Indeed, the import is not needed. Are you interested in creating a PR to fix the docstring?

@namanvats
Copy link
Contributor

namanvats commented Jun 12, 2024

@BenjaminBossan Created a PR to fix the redundant import: #1850

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants