Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

Fix: Replace deprecated huggingface_hub.get_token_permission() with whoami() (#8913)

Alexander Eichhornec46b5cb9eb0
diff --git a/invokeai/app/api/routers/model_manager.py b/invokeai/app/api/routers/model_manager.py
index a1f6b3a744..234c6c9662 100644
--- a/invokeai/app/api/routers/model_manager.py
+++ b/invokeai/app/api/routers/model_manager.py
@@ -1141,11 +1141,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