Buckets:
| # 로그인 및 로그아웃[[login-and-logout]] | |
| `huggingface_hub` 라이브러리를 사용하면 사용자의 기기를 Hub에 프로그래밍적으로 로그인/로그아웃할 수 있습니다. | |
| 인증에 대한 자세한 내용은 [이 섹션](../quick-start#authentication)을 확인하세요. | |
| ## 로그인[[login]][[huggingface_hub.login]] | |
| - **token** (`str`, *optional*) -- | |
| User access token to generate from https://huggingface.co/settings/token. | |
| - **add_to_git_credential** (`bool`, defaults to `False`) -- | |
| If `True`, token will be set as git credential. If no git credential helper | |
| is configured, a warning will be displayed to the user. Only used when `token` | |
| is provided; ignored by the browser-based flow. | |
| - **skip_if_logged_in** (`bool`, defaults to `True`) -- | |
| If `True`, do not prompt for token if user is already logged in. | |
| Set to `False` to force re-login. In CLI, use `--force` instead.- [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError) -- | |
| If an organization token is passed. Only personal account tokens are valid | |
| to log in. | |
| - [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError) -- | |
| If token is invalid. | |
| - `DeviceCodeError` -- | |
| If the browser-based login fails (authorization denied, code expired, ...).``ValueError`` or `DeviceCodeError` | |
| Login the machine to access the Hub. | |
| The `token` is persisted in cache and set as a git credential. Once done, the machine | |
| is logged in and the access token will be available across all `huggingface_hub` | |
| components. If `token` is not provided, a browser-based OAuth flow is used to | |
| authenticate: open a URL, enter a short code, and the token is retrieved and saved. | |
| In a terminal, you can also choose to paste an existing access token instead. | |
| To log in from outside of a script, one can also use `hf auth login` which is | |
| a cli command that wraps [login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.login). | |
| > [!TIP] | |
| > When the token is not passed, [login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.login) will automatically detect if the script runs | |
| > in a notebook or not. However, this detection might not be accurate due to the | |
| > variety of notebooks that exists nowadays. If that is the case, you can always force | |
| > the UI by using [notebook_login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.notebook_login) or [interpreter_login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.interpreter_login). | |
| ## 인터프리터_로그인[[interpreter_login]][[huggingface_hub.interpreter_login]] | |
| - **skip_if_logged_in** (`bool`, defaults to `True`) -- | |
| If `True`, do not prompt for token if user is already logged in. | |
| Set to `False` to force re-login. In CLI, use `--force` instead. | |
| Displays a prompt to log in to the HF website and store the token. | |
| This is equivalent to [login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.login) without passing a token when not run in a notebook. | |
| [interpreter_login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.interpreter_login) is useful if you want to force the use of the terminal prompt | |
| instead of a notebook flow. | |
| For more details, see [login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.login). | |
| ## 노트북_로그인[[notebook_login]][[huggingface_hub.notebook_login]] | |
| - **skip_if_logged_in** (`bool`, defaults to `True`) -- | |
| If `True`, do not prompt for token if user is already logged in. | |
| Set to `False` to force re-login. In CLI, use `--force` instead. | |
| Displays a prompt to log in to the HF website and store the token. | |
| This is equivalent to [login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.login) without passing a token when run in a notebook. | |
| [notebook_login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.notebook_login) is useful if you want to force the use of the notebook flow | |
| instead of a prompt in the terminal. | |
| For more details, see [login()](/docs/huggingface_hub/pr_4199/ko/package_reference/login#huggingface_hub.login). | |
| ## 로그아웃[[logout]][[huggingface_hub.logout]] | |
| - **token_name** (`str`, *optional*) -- | |
| Name of the access token to logout from. If `None`, will log out from all saved access tokens.- [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError) -- | |
| If the access token name is not found.``ValueError`` | |
| Logout the machine from the Hub. | |
| Token is deleted from the machine and removed from git credential. | |
Xet Storage Details
- Size:
- 4.64 kB
- Xet hash:
- 4577b018fa4fa88f7034fd7c05d0f14ce80a9b331ad19cac6e41b206f3acd1d9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.