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

An error in code comments (peft_model.py) #881

Closed
4 tasks
houx15 opened this issue Aug 30, 2023 · 2 comments
Closed
4 tasks

An error in code comments (peft_model.py) #881

houx15 opened this issue Aug 30, 2023 · 2 comments

Comments

@houx15
Copy link
Contributor

houx15 commented Aug 30, 2023

System Info

the newest peft code in this repo

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder
  • My own task or dataset (give details below)

Reproduction

line 137 in peft_model.py:

    def save_pretrained(
        self,
        save_directory: str,
        safe_serialization: bool = False,
        selected_adapters: Optional[List[str]] = None,
        **kwargs: Any,
    ):
        r"""
        This function saves the adapter model and the adapter configuration files to a directory, so that it can be
        reloaded using the [`LoraModel.from_pretrained`] class method, and also used by the [`LoraModel.push_to_hub`]
        method.

wrote that "reloaded using the LoraModel.from_pretrained"

However, the class LoraModel doesn't have a function named from_pretrained()

Expected behavior

It should be PeftModel.from_pretrained()

@BenjaminBossan
Copy link
Member

Thanks for reporting this, it is indeed an error in the docs. Same goes for LoraModel.push_to_hub, which should be PeftModel.push_to_hub. Do you want to create a PR to fix it? Otherwise, I'll do it.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

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

No branches or pull requests

2 participants