OpenCodeInterpreter / OpenCodeInterpreter

OpenCodeInterpreter is a suite of open-source code generation systems aimed at bridging the gap between large language models and sophisticated proprietary systems like the GPT-4 Code Interpreter. It significantly enhances code generation capabilities by integrating execution and iterative refinement functionalities.
https://opencodeinterpreter.github.io/
Apache License 2.0
1.56k stars 202 forks source link

You don't have the rights to create a dataset under this namespace #13

Closed henrywoo closed 7 months ago

henrywoo commented 7 months ago

I am running the chatbot code but got this error:

Traceback (most recent call last):
  File "/home/wukong/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 286, in hf_raise_for_status
    response.raise_for_status()
  File "/home/wukong/miniconda3/envs/codellm/lib/python3.10/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/wukong/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 3178, in create_repo
    hf_raise_for_status(r)
  File "/home/wukong/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 333, 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-65df6259-43ca42c30a8ffc720e3ef19c;ac004ca6-70d3-4824-9e08-1ffd0fe6dcad)

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

how to fix it?

AnitaLiu98 commented 7 months ago

You might want to use a Hugging Face token with write permissions instead of just a token with read permissions. You can refer to: https://huggingface.co/docs/hub/security-tokens

henrywoo commented 7 months ago
$huggingface-cli login --token $HF_TOKEN_REDWOOD 
Token will not been saved to git credential helper. Pass `add_to_git_credential=True` if you want to set the git credential as well.
Token is valid (permission: write).
Your token has been saved to /home/hellcat/.cache/huggingface/token
Login successful

Then I still got:

$python chatbot.py 
/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/bitsandbytes/cextension.py:34: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers, 8-bit multiplication, and GPU quantization are unavailable.
  warn("The installed version of bitsandbytes was compiled without GPU support. "
/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cpu.so: undefined symbol: cadam32bit_grad_fp32
Traceback (most recent call last):
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 286, in hf_raise_for_status
    response.raise_for_status()
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/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/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 3178, in create_repo
    hf_raise_for_status(r)
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 333, 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-65df6a10-33579ae56032e4cc528ebbaa;10b7feca-a671-4a62-8aaa-f90275c0a404)

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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 286, in hf_raise_for_status
    response.raise_for_status()
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/datasets/opencodeinterpreter_user_data

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

Traceback (most recent call last):
  File "/media/hellcat/dataext4/OpenCodeInterpreter/demo/chatbot.py", line 34, in <module>
    scheduler = CommitScheduler(
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/_commit_scheduler.py", line 117, in __init__
    repo_url = self.api.create_repo(repo_id=repo_id, private=private, repo_type=repo_type, exist_ok=True)
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 3186, in create_repo
    self.repo_info(repo_id=repo_id, repo_type=repo_type, token=token)
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2275, in repo_info
    return method(
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2148, in dataset_info
    hf_raise_for_status(r)
  File "/home/hellcat/miniconda3/envs/codellm/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 323, in hf_raise_for_status
    raise RepositoryNotFoundError(message, response) from e
huggingface_hub.utils._errors.RepositoryNotFoundError: 404 Client Error. (Request ID: Root=1-65df6a10-568bea6e0dc084ca31493ab6;64a44af2-ccd2-40c2-b5c8-d0fe009392b9)

Repository Not Found for url: https://huggingface.co/api/datasets/opencodeinterpreter_user_data.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated.
AnitaLiu98 commented 7 months ago

We attempted to reproduce the error you mentioned by replacing the token with write permissions with one that only has read permissions. Are you using a token with write permissions in export HF_TOKEN="your huggingface access token"?

henrywoo commented 7 months ago

It is weird but it is working now after a reboot.

AnitaLiu98 commented 7 months ago

Good to know it's working now after the reboot. If you run into any more hiccups, feel free to reach out.