-
Notifications
You must be signed in to change notification settings - Fork 30.4k
Add Hugging Face authentication procedure for IDEs (PyCharm, VS Code,… #38954
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
Hi @stevhliu, could you please review this PR and let me know if any improvements are needed? |
Hi @stevhliu, just following up on the PR to check if you had a chance to review it, and let me know if any changes are required. Thanks a lot! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, left some notes about keeping it simple!
docs/source/en/quicktour.md
Outdated
### Authenticate with Hugging Face | ||
<hfoptions id="authenticate"> | ||
1. For Jupyter Notebooks: | ||
<hfoption id="notebook"> | ||
If you're working in a Jupyter Notebook, you can log in to your Hugging Face account using the `notebook_login` function from the `huggingface_hub` library. Here's how to do it: | ||
- Install the necessary library if you haven't already: | ||
```bash | ||
pip install huggingface_hub | ||
``` | ||
- Use the following code to log in: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be even simpler:
### Authenticate with Hugging Face | |
<hfoptions id="authenticate"> | |
1. For Jupyter Notebooks: | |
<hfoption id="notebook"> | |
If you're working in a Jupyter Notebook, you can log in to your Hugging Face account using the `notebook_login` function from the `huggingface_hub` library. Here's how to do it: | |
- Install the necessary library if you haven't already: | |
```bash | |
pip install huggingface_hub | |
``` | |
- Use the following code to log in: | |
<hfoptions id="authenticate"> | |
<hfoption id="notebook"> | |
Paste your User Access Token into [`~huggingface_hub.notebook_login`] when prompted to log in. |
docs/source/en/quicktour.md
Outdated
This will trigger a login prompt that will ask you to paste your Hugging Face token. | ||
You can find your token on your [Hugging Face settings page](https://huggingface.co/settings/tokens) | ||
</hfoption> | ||
|
||
2. For IDEs (PyCharm, VS Code, etc.): | ||
<hfoption id="CLI"> | ||
If you're using an IDE like PyCharm or VS Code, follow these steps to log in to your Hugging Face account via the command line interface (CLI): | ||
- Install the `huggingface_hub` CLI: | ||
You need to install the `huggingface_hub[cli]` package. You can do this by running the following command: | ||
```bash | ||
pip install -U "huggingface_hub[cli]" | ||
``` | ||
- Log in using the CLI: | ||
Run the following command in your terminal: | ||
```huggingface-cli login``` | ||
This will prompt you to enter your Hugging Face token. Paste your token and hit Enter. | ||
Once you input the token, the CLI will authenticate your session, and you will be logged into Hugging Face. | ||
For more details and available options for huggingface-cli, you can use: | ||
```bash | ||
huggingface-cli --help | ||
``` | ||
Or check the official [documentation](https://huggingface.co/docs/huggingface_hub/guides/cli | ||
) for further information. | ||
</hfoption> | ||
</hfoptions> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will trigger a login prompt that will ask you to paste your Hugging Face token. | |
You can find your token on your [Hugging Face settings page](https://huggingface.co/settings/tokens) | |
</hfoption> | |
2. For IDEs (PyCharm, VS Code, etc.): | |
<hfoption id="CLI"> | |
If you're using an IDE like PyCharm or VS Code, follow these steps to log in to your Hugging Face account via the command line interface (CLI): | |
- Install the `huggingface_hub` CLI: | |
You need to install the `huggingface_hub[cli]` package. You can do this by running the following command: | |
```bash | |
pip install -U "huggingface_hub[cli]" | |
``` | |
- Log in using the CLI: | |
Run the following command in your terminal: | |
```huggingface-cli login``` | |
This will prompt you to enter your Hugging Face token. Paste your token and hit Enter. | |
Once you input the token, the CLI will authenticate your session, and you will be logged into Hugging Face. | |
For more details and available options for huggingface-cli, you can use: | |
```bash | |
huggingface-cli --help | |
``` | |
Or check the official [documentation](https://huggingface.co/docs/huggingface_hub/guides/cli | |
) for further information. | |
</hfoption> | |
</hfoptions> | |
</hfoption> | |
<hfoption id="CLI"> | |
Make sure the [huggingface_hub[cli]](https://huggingface.co/docs/huggingface_hub/guides/cli#getting-started) package is installed and run the command below. Paste your User Access Token when prompted to log in. | |
```bash | |
huggingface-cli login |
e48b9d5
to
f39e3e2
Compare
Hi @stevhliu, I made some changes. Please review and let me know if there's room for improvement. |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving!
… etc.)
What does this PR do?
This PR aims to resolve #38918 by guiding users on how to authenticate their Hugging Face accounts using IDEs (PyCharm, VS Code, etc.).
Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.