I am trying to login to huggingface CLI on my new computer. I get this error.
requests.exceptions.ConnectionError: (ProtocolError(‘Connection aborted.’, ConnectionResetError(10054, ‘An existing connection was forcibly closed by the remote host’, None, 10054, None)), ‘(Request ID: 23e02426-d980-4aa2-bf60-21bb648652c4)’)
I dont know what to do next.
EDIT: here is minimal reproducible code that reproduces my problem.
def send_whoami_request():
url = "https://huggingface.co/api/whoami-v2"
headers = {
"user-agent": "unknown/None; hf_hub/0.20.3; python/3.9.18",
"Accept-Encoding": "gzip, deflate",
"Accept": "*/*",
"Connection": "keep-alive",
"authorization": "Bearer xxx",
}
response = requests.get(url, headers=headers)
# Print the response status code and content for inspection
print("Status Code:", response.status_code)
print("Response:", response.json())
send_whoami_request()
It runs through ONCE on windows and then fails consistently. On WSL, it succeeds consistently.