From e80222ce93f1bf80eecd771f83d69121e8d0dae6 Mon Sep 17 00:00:00 2001 From: Alexander Eichhorn Date: Wed, 25 Feb 2026 23:06:01 +0100 Subject: [PATCH] Fix: Replace deprecated huggingface_hub.get_token_permission() with whoami() `get_token_permission` is deprecated and will be removed in huggingface_hub 1.0. Use `whoami()` to validate the token instead, as recommended by the deprecation warning. --- invokeai/app/api/routers/model_manager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/invokeai/app/api/routers/model_manager.py b/invokeai/app/api/routers/model_manager.py index d2e6f6096e9..11889c6a08c 100644 --- a/invokeai/app/api/routers/model_manager.py +++ b/invokeai/app/api/routers/model_manager.py @@ -1128,11 +1128,11 @@ class HFTokenHelper: @classmethod def get_status(cls) -> HFTokenStatus: try: - if huggingface_hub.get_token_permission(huggingface_hub.get_token()): - # Valid token! - return HFTokenStatus.VALID - # No token set - return HFTokenStatus.INVALID + token = huggingface_hub.get_token() + if not token: + return HFTokenStatus.INVALID + huggingface_hub.whoami(token=token) + return HFTokenStatus.VALID except Exception: return HFTokenStatus.UNKNOWN