add on_main_process decorators#488
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
sgugger
left a comment
There was a problem hiding this comment.
Thanks for your PR! I think it would be great to have those as methods of the Accelerator object (your code refers to a `self`` that does not exist otherwise).
|
Hi @sgugger , sorry for the delay, hope this is better now |
|
@ZhiyuanChen could you run "make style; make quality" to solve the Quality Check issue? 😃 Thanks! |
Sorry, I thought I have fixed it but somehow didn't pushed... |
sgugger
left a comment
There was a problem hiding this comment.
Thanks a lot for iterating! Almost ready to merge, I just left some comments on the docstrings and a suggestion to group the decorators on_process and on_local_process together. Let me know your thoughts!
|
|
||
| return wrapper | ||
|
|
||
| def on_process(process_idx): |
There was a problem hiding this comment.
| def on_process(process_idx): | |
| def on_process(process_idx, local=False): |
Maybe we could group this one and the text in one decorator since it's one that takes arguments?
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Thank you very much tor your comments and suggestion. For the docstrings, i have accepted rll suggestions. For the group... I think its rather important to ensure api in a similar organisation, and grouping in this way break the consistency with |
|
Let's roll with your choice and we'll see what users think then. We can always add aliases in the future :-) Thanks again for your contribution! |
Haha, sure thing~
No worries~ |
#366