How to solve a `403 Client Error`?

#1
by DanielCL - opened

I have cloned the repo successfully and pickle file is generated successfully too, but still got this error.

Any idea of how to solve it? Thanks!

Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
***********INSIDE CREATE SEARCH INDEX***************
Cloning into '.'...
***********INSIDE DRIVER***************
***********INSIDE CREATE SPACE***************
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 264, in hf_raise_for_status
    response.raise_for_status()
  File "/home/user/.local/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/gradio/routes.py", line 289, in run_predict
    output = await app.blocks.process_api(
  File "/home/user/.local/lib/python3.8/site-packages/gradio/blocks.py", line 991, in process_api
    result = await self.call_function(fn_index, inputs, iterator)
  File "/home/user/.local/lib/python3.8/site-packages/gradio/blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/user/.local/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/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/home/user/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "app.py", line 133, in driver
    create_space(repo_link, hf_token)
  File "app.py", line 54, in create_space
    repo_url = api.create_repo(
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2010, in create_repo
    hf_raise_for_status(r)
  File "/home/user/.local/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 318, in hf_raise_for_status
    raise HfHubHTTPError(str(e), response=response) from e
huggingface_hub.utils._errors.HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create (Request ID: Root=1-63df9ad8-600e75a266385a1a03469582)

You don't have the rights to create a space under this namespace

This could mean that the hf_token that you provided is either incorrect or has read access only. Make sure your hf_token has write access too.

ysharma changed discussion status to closed

Let me know if this doesn't solve it for you.

Sign up or log in to comment