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

Skip token in push_to_hub #1945

Merged
merged 3 commits into from
Aug 19, 2024
Merged

Skip token in push_to_hub #1945

merged 3 commits into from
Aug 19, 2024

Conversation

qgallouedec
Copy link
Member

No description provided.

@qgallouedec qgallouedec requested a review from lewtun August 19, 2024 07:48
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

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

Thanks for the safety improvement! My main question is whether we need to have commented out args - is there a cleaner way?

@@ -1432,12 +1432,12 @@ def push_to_hub(
self,
commit_message: Optional[str] = "End of training",
blocking: bool = True,
token: Optional[str] = None,
# token: Optional[str] = None, # Unlike the parent class, skip the token to mitigate security risks.
Copy link
Member

Choose a reason for hiding this comment

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

Can't we delete altogether instead of having this commented out code?

Suggested change
# token: Optional[str] = None, # Unlike the parent class, skip the token to mitigate security risks.

Copy link
Member Author

Choose a reason for hiding this comment

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

We can.
I just want to find a way to tell my future self not to re-add it. I'll add to the comment below, let me know if that's ok.

Copy link
Member

Choose a reason for hiding this comment

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

This is better, thanks!

@qgallouedec
Copy link
Member Author

Note that thanks to @wraps(Trainer.push_to_hub), the docstring ("""Overwrite the `push_to_hub` method in order to ...""") won't appear in the online doc. It will only be visible in the source code.

Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

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

Thanks for iterating, LGTM!

@qgallouedec qgallouedec merged commit 9955583 into main Aug 19, 2024
10 checks passed
@qgallouedec qgallouedec deleted the skip-token branch August 19, 2024 09:34
qgallouedec added a commit that referenced this pull request Aug 23, 2024
* Skip token in `push_to_hub`

* fix doc

* move comment

---------

Co-authored-by: Quentin Gallouédec <quentin.gallouedec@huggingface.co>
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