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
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.
