Skip to content

Conversation

marcndo
Copy link
Contributor

@marcndo marcndo commented Jun 20, 2025

… 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

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

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.

@marcndo
Copy link
Contributor Author

marcndo commented Jun 21, 2025

Hi @stevhliu, could you please review this PR and let me know if any improvements are needed?

@marcndo
Copy link
Contributor Author

marcndo commented Jun 23, 2025

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!

Copy link
Member

@stevhliu stevhliu left a 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!

Comment on lines 35 to 44
### 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:
Copy link
Member

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:

Suggested change
### 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.

Comment on lines 50 to 53
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>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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
```

@marcndo marcndo force-pushed the doc/38918_authentication branch from e48b9d5 to f39e3e2 Compare June 24, 2025 17:31
@marcndo
Copy link
Contributor Author

marcndo commented Jun 24, 2025

Hi @stevhliu, I made some changes. Please review and let me know if there's room for improvement.

@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

@stevhliu stevhliu 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 improving!

@stevhliu stevhliu merged commit 48b6ef0 into huggingface:main Jun 24, 2025
10 checks passed
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.

Lack of IDE-Specific Authentication Instructions in Hugging Face "Quickstart" Documentation
3 participants