Comments (8)
Thanks for looking in this @lappemic! Totally agree with you this would benefit from some harmonization.
For the record, ~2y ago tokens where not used by default, hence the boolean value. Now, tokens are always sent when the user is logged in (either via env variable or huggingface-cli login
). So the only boolean value that is relevant is token=False
to explicitly refuse authentication.
So if there is harmonization, it should be towards
Option 2:
token: Union[bool, str, None] = None
About the attribute description. I would update it to mention that the recommended way to login is not by using this arg but rather login the machine itself. What do you think of:
"A valid user access token (string). If not set, will default to the locally saved one. Pass
token=False
to explicitly disable authentication. Note that the recommended way to authenticate is usually with a locally saved token (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication)."
?
from huggingface_hub.
The description sounds reasonable and is clear π
I will open a PR for this the next days.
from huggingface_hub.
And thanks for raising this topic + propose your help on this one! It's something that always bothered me but never really addressed π
from huggingface_hub.
The second version is definitely less verbose. I just stumble across the "Finally" in the last sentence which is in my understanding like the last step in an "actionchain" (regardless the actions before). I do not want to make it picky, but what would you think about:
A valid user access token (string). Defaults to the locally saved token, which is the recommended method for authentication (see Hugging Face Hub Quick Start). To disable authentication, pass
False
.
from huggingface_hub.
Thanks for the suggestion, let's use that! I'd just update it to set the url directly in the docstring. I think it's better for users reading the srouce code directly (so not rendered),
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
.
from huggingface_hub.
Close by @lappemic in #2252. Thanks!
from huggingface_hub.
Second version? (less verbose)
"A valid user access token (string). If not set, will default to the locally saved one which is the recommended way to authenticate (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication). Finally, pass
False
to explicitly disable authentication."
from huggingface_hub.
And thanks for raising this topic + propose your help on this one! It's something that always bothered me but never really addressed π
Haha, addressing every itch would just be too overwhelming π Glad i can help out here!
from huggingface_hub.
Related Issues (20)
- ImportError: cannot import name 'is_jsonable' from 'huggingface_hub.utils' (/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/__init__.py) HOT 3
- Error using from_pretrained_keras model HOT 8
- [CLI] Command line to delete files on a repo HOT 5
- cli download --local-dir broken HOT 1
- Change `HUGGINGFACE_CO_URL_TEMPLATE` with environment variable HOT 1
- I'm ππ»begging you for an π π»ββοΈUnfollowButton HOT 1
- Issue occured when using jupyter lab HOT 3
- Document question answering returns empty list without an error HOT 4
- Content-Range header for multiple part request HOT 4
- No package metadata was found for bitsandbytes HOT 7
- can't dowload the GGUF, it progress stoped at 1% HOT 1
- Filter by tags with list_datasets() API HOT 1
- Consider using `hf_transfer` for faster uploads. T HOT 1
- ValueError: Unable to retrieve user and repo ID from the passed HF ID: https://huggingface.co/MonolithFoundation/Bumblebee-Light HOT 12
- Timeout when downloading dataset metadata with 8 torchrun workers HOT 3
- Invalid input data for `ImageToTextOutput`: Expected a single instance, but got a list. HOT 2
- Any `AutoConfig.from_pretrained` call results in `FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0.` HOT 2
- Failed to download Phi-3-mini-4k-instruct to local dir HOT 1
- HfAPI().create_inference_endpoint errors and does not follow documentation HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from huggingface_hub.