File size: 283 Bytes
fbb55fa
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import os
from huggingface_hub import whoami

token = os.getenv("HF_TOKEN")
print(f"Token exists: {token is not None}")
if token:
    try:
        user_info = whoami(token)
        print(f"Token works! User: {user_info}")
    except Exception as e:
        print(f"Token error: {e}")