Code Monkey home page Code Monkey logo

Comments (8)

Wauplin avatar Wauplin commented on June 2, 2024 1

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.

lappemic avatar lappemic commented on June 2, 2024 1

The description sounds reasonable and is clear πŸ‘

I will open a PR for this the next days.

from huggingface_hub.

Wauplin avatar Wauplin commented on June 2, 2024 1

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.

lappemic avatar lappemic commented on June 2, 2024 1

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.

Wauplin avatar Wauplin commented on June 2, 2024 1

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.

Wauplin avatar Wauplin commented on June 2, 2024 1

Close by @lappemic in #2252. Thanks!

from huggingface_hub.

Wauplin avatar Wauplin commented on June 2, 2024

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.

lappemic avatar lappemic commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.