OSError: Token is required (`token=True`), but no token found.

#10
by chrispie - opened

I am getting this error at the end after the convertion. I did fill in the write token though.
After running it the second time it worked fine.

Converting to CKPT ...
Traceback (most recent call last):
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/routes.py", line 292, in run_predict
    output = await app.blocks.process_api(
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/blocks.py", line 1007, in process_api
    result = await self.call_function(fn_index, inputs, iterator, request)
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/blocks.py", line 848, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "app.py", line 282, in train
    push(model_name, where_to_upload, hf_token, which_model, True)
  File "app.py", line 309, in push
    your_username = api.whoami(token=hf_token)["name"]
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 589, in whoami
    headers=self._build_hf_headers(
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3397, in _build_hf_headers
    return build_hf_headers(
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/huggingface_hub/utils/_headers.py", line 117, in build_hf_headers
    token_to_send = get_token_to_send(token)
  File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/huggingface_hub/utils/_headers.py", line 149, in get_token_to_send
    raise EnvironmentError(
OSError: Token is required (`token=True`), but no token found. You need to provide a token or be logged in to Hugging Face with `huggingface-cli login` or `huggingface_hub.login`. See https://huggingface.co/settings/tokens.

Thanks for flagging. I could not replicate. But as it worked the second time, either it was a strange bug or maybe there was something strange with the token. Nonetheless I'll keep monitoring this error thanks for flaggign

multimodalart changed discussion status to closed

Sign up or log in to comment