Unauthorized Access Token

Try v2.

HF_TOKEN = "hf_foobar"
import subprocess
subprocess.run(f'curl -H "Authorization: Bearer {HF_TOKEN}" https://huggingface.co/api/whoami', shell=True)
# {"error":"Invalid credentials in Authorization header"}
subprocess.run(f'curl -H "Authorization: Bearer {HF_TOKEN}" https://huggingface.co/api/whoami-v2', shell=True)
# {"type":"user", ...