diff --git a/src/huggingface_hub/hf_api.py b/src/huggingface_hub/hf_api.py index f4bc1e5564..cfe980f75c 100644 --- a/src/huggingface_hub/hf_api.py +++ b/src/huggingface_hub/hf_api.py @@ -1178,8 +1178,8 @@ def model_info( Returns: [`huggingface_hub.hf_api.ModelInfo`]: The model repository information. """ - - token, _ = self._validate_or_retrieve_token(token, function_name="model_info") + if token is None: + token = HfFolder.get_token() path = ( f"{self.endpoint}/api/models/{repo_id}"