-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Update Docstring for create_model #1643
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
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
|
Thanks for the eample. I'm definitely open to improving docstrings, buti it's going to differ from Transformers and follow Google style a bit more closely.
Google: Numpy: FYI the HF use of 'optional' in docstrings is objectively confusing AF to anyone who's been programming Python for awhile
|
Will have to check if this will do wonky things with doc builder, I'm not mad at this though. Could actually make this docstring in particular a lot easier to read (as long as the rendered version isnt looking for a closing
Fine by me!
Yea I was just following the HF pattern...imo I agree w/ you. Lets do without here. |
Definitely 100% agree |
|
@rwightman feel free to take a second look, I think I made the changes you requested. Only issue I see is in the docstring for the kwargs its making one of the |
|
@nateraw was going to allocate a bit more time to see how others might be handling the kwargs, I feel the old approach was a bit more clear, but non-standard, and this current approach looks a bit off.. hmmm |
|
Agree. I'll think of some options too |
|
@nateraw circling back to this after wrapping up the epic hub model push & multi-weight conversions... On the kwargs thing, I feel there are 3 realistic options, 1 was my original choice, 2 is your change, and I've seen 3 out there... 1 2 3 For kwargs I feel the
For anything that doesn't have support the parsing addition is minor compared to fully supporting 3, and 2 doesn't have separation of args vs kwargs that I'd like. |
Playing with updating some docstrings. Will likely do this across multiple PRs. For now, just
create_model.Wanted to make sure @rwightman doesn't oppose any of the style changes here.
Here's everything I've changed here:
<name>: (<type>, *optional*, defaults to ...)syntax/style, which is consistent across all HF docs.help(create_model)in Python as well as when it gets rendered in the docs.<Tip>...</Tip>, which highlights sections nicely.The rendered docstring for this can be seen live here.