Aider-AI / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
22.74k stars 2.12k forks source link

Uncaught ValueError in registry.py line 51 #2288

Closed ndmikkelsen closed 3 weeks ago

ndmikkelsen commented 3 weeks ago

Aider version: 0.62.1 Python version: 3.12.7 Platform: macOS-14.6.1-arm64-arm-64bit Python implementation: CPython Virtual environment: Yes OS: Darwin 23.6.0 (64bit) Git version: git version 2.39.3 (Apple Git-146)

An uncaught exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 622, in main
    main_model = models.Model(
                 ^^^^^^^^^^^^^
  File "models.py", line 769, in __init__
    res = self.validate_environment()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "models.py", line 973, in validate_environment
    res = litellm.validate_environment(model)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "llm.py", line 23, in __getattr__
    self._load_litellm()
  File "llm.py", line 30, in _load_litellm
    self._lazy_module = importlib.import_module("litellm")
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "__init__.py", line 858, in <module>
    from .cost_calculator import completion_cost
  File "cost_calculator.py", line 22, in <module>
    from litellm.llms.anthropic.cost_calculation import (
  File "cost_calculation.py", line 9, in <module>
    from litellm.utils import get_model_info
  File "utils.py", line 137, in <module>
    encoding = tiktoken.get_encoding("cl100k_base")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "registry.py", line 75, in get_encoding
    _find_constructors()
  File "registry.py", line 51, in _find_constructors
    raise ValueError(
ValueError: Duplicate encoding name gpt2 in tiktoken plugin tiktoken_ext.openai_public
paul-gauthier commented 3 weeks ago

Thanks for trying aider and filing this issue.

How did you install aider? What environment are you using? It looks like you don't have the correct set of dependencies installed. This doc may be helpful:

https://aider.chat/docs/troubleshooting/imports.html

I'm going to close this issue for now, but feel free to add a comment here and I will re-open. Or feel free to file a new issue any time.

ndmikkelsen commented 3 weeks ago

This can be closed.

On Thu, Nov 7, 2024 at 3:06 PM paul-gauthier @.***> wrote:

Thanks for trying aider and filing this issue.

How did you install aider? What environment are you using? It looks like you don't have the correct set of dependencies installed. This doc may be helpful:

https://aider.chat/docs/troubleshooting/imports.html

I'm going to close this issue for now, but feel free to add a comment here and I will re-open. Or feel free to file a new issue any time.

— Reply to this email directly, view it on GitHub https://github.com/Aider-AI/aider/issues/2288#issuecomment-2463214433, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3IPAXZNPKCRTO4YPMORQTZ7PI5PAVCNFSM6AAAAABRLRRTPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRTGIYTINBTGM . You are receiving this because you authored the thread.Message ID: @.***>