import requests from huggingface_hub import whoami def validate_hf_token(token): """Validates the HF token and returns user info.""" try: user_info = whoami(token=token) return user_info except Exception as e: print(f"Token validation failed: {e}") return None