Skip to content

Conversation

@samsja
Copy link
Contributor

@samsja samsja commented Jun 12, 2023

Context

This small PR add a return type hint on get_peft_model.

This makes it easier for IDE (in my case pycharm) to propose shortcuts and suggestions if it knows the type of return objet.

For instance without the type hint in pycharm I cannot click on save_pretrained of peft a model and see the signature. This is because pycharm don't know that the object is a peft model. Return type hint fixed this

Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 13, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @samsja for adding this!

@pacman100 pacman100 merged commit 1cbc985 into huggingface:main Jun 13, 2023
@samsja
Copy link
Contributor Author

samsja commented Jun 14, 2023

@pacman100 I noticed they are several places where it could be useful to have more type hint. Would you be interested as well in a bigger PR ?

Guy-Bilitski pushed a commit to Guy-Bilitski/peft that referenced this pull request May 13, 2025
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
cyyever pushed a commit to cyyever/peft that referenced this pull request Sep 4, 2025
* correct glitches in reward modelling

* add the eval_split option

* correct code format
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 this pull request may close these issues.

3 participants