[x] I have searched to see if a similar issue already exists.
Functions in the huggingface_hub library automatically uses HF_TOKEN for token when token is not specified and the environment variable exists, so I think it would be useful if the hf_token parameter in gr.load behaved in the same way.
Yeah we can do that. For security reasons, we wouldn't want to pass it when loading a Space (since a Space in theory can read the incoming headers) but we can do it when loading models.
Functions in the
huggingface_hub
library automatically usesHF_TOKEN
fortoken
whentoken
is not specified and the environment variable exists, so I think it would be useful if thehf_token
parameter ingr.load
behaved in the same way.