Download test_token.py from SlouchyBuffalo/pages-converter-pro: direct link, hf CLI and curl.
- Browser
- Download file 283 Bytes
-
https://huggingface.co/spaces/SlouchyBuffalo/pages-converter-pro/resolve/fbb55fa9bd47ea74999842341db22acc4af5e1b8/test_token.py
- Command line
-
hf download hf://spaces/SlouchyBuffalo/pages-converter-pro@fbb55fa9bd47ea74999842341db22acc4af5e1b8/test_token.py
-
curl -L -o test_token.py https://huggingface.co/spaces/SlouchyBuffalo/pages-converter-pro/resolve/fbb55fa9bd47ea74999842341db22acc4af5e1b8/test_token.py
283 Bytes
| 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}") |