Skip to content

[hub] - hf hub internal api no longer returns an error for invalid access tokens when using listFiles for a gated model #945

@phudtran

Description

@phudtran

Issue

Hi, not sure if this is the correct place to post this issue since it seems to be an internal api change.

Previously, listing files in a gated repo using listFiles with an invalid or undefined access token would throw an authentication error. Now the authentication error is not thrown until an attempt is made to download one of the gated files with said invalid token.

Would it be possible/within scope to add some kind of hint to specify whether or not the user provided access token used in listModels/listFiles is able to access the gated model.

Example

image

For example, when going to https://huggingface.co/google/gemma-2b/tree/main, I am immediately informed whether or not I have access to the gated model.

Use case

Jellybox allows users to input their access token to download gated models after accepting the model conditions.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions