From a6fbf16dc4845798e49b46fe4ed5f654f4f4ea84 Mon Sep 17 00:00:00 2001 From: Michael <61876623+lappemic@users.noreply.github.com> Date: Wed, 22 May 2024 14:49:07 +0200 Subject: [PATCH] Update token type definition and arg description in `hf_file_system.py` (#2278) * docs: update token type definition and arg description in `hf_file_system.py` * Update src/huggingface_hub/hf_file_system.py --------- Co-authored-by: Lucain --- src/huggingface_hub/hf_file_system.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/huggingface_hub/hf_file_system.py b/src/huggingface_hub/hf_file_system.py index 91cbb688b1..7518d6684d 100644 --- a/src/huggingface_hub/hf_file_system.py +++ b/src/huggingface_hub/hf_file_system.py @@ -74,8 +74,11 @@ class HfFileSystem(fsspec.AbstractFileSystem): Access a remote Hugging Face Hub repository as if were a local file system. Args: - token (`str`, *optional*): - Authentication token, obtained with [`HfApi.login`] method. Will default to the stored token. + token (`str` or `bool`, *optional*): + A valid user access token (string). Defaults to the locally saved + token, which is the recommended method for authentication (see + https://huggingface.co/docs/huggingface_hub/quick-start#authentication). + To disable authentication, pass `False`. Usage: @@ -105,7 +108,7 @@ def __init__( self, *args, endpoint: Optional[str] = None, - token: Optional[str] = None, + token: Union[bool, str, None] = None, **storage_options, ): super().__init__(*args, **storage_options)