rsaryev / talk-codebase

Tool for chatting with your codebase and docs using OpenAI, LlamaCpp, and GPT-4-All
MIT License
476 stars 39 forks source link

cannot import name 'LlamaGrammar' from 'llama_cpp' #65

Open ericlaycock opened 2 months ago

ericlaycock commented 2 months ago

I successfully installed talk-codebase, its dependencies and a local model (Falcon), but for some reason a call is being made to llama-cpp-python for LlamaGrammar, which the current version of llama-cpp-python (0.1.68) doesn't seem to have. If an older version is needed, what version is needed?

(base) eric@eric-g17:~/test1/test1$ pip install llama-cpp-python==0.1.68
Collecting llama-cpp-python==0.1.68
  Using cached llama_cpp_python-0.1.68-cp311-cp311-linux_x86_64.whl
Requirement already satisfied: typing-extensions>=4.5.0 in /home/eric/miniconda3/lib/python3.11/site-packages (from llama-cpp-python==0.1.68) (4.11.0)
Requirement already satisfied: numpy>=1.20.0 in /home/eric/miniconda3/lib/python3.11/site-packages (from llama-cpp-python==0.1.68) (1.23.5)
Requirement already satisfied: diskcache>=5.6.1 in /home/eric/miniconda3/lib/python3.11/site-packages (from llama-cpp-python==0.1.68) (5.6.3)
Installing collected packages: llama-cpp-python
Successfully installed llama-cpp-python-0.1.68

(base) eric@eric-g17:~/test1/test1$ talk-codebase chat ./
🤖 Config path: /home/eric/.talk_codebase_config.yaml:
Found model file at  /home/eric/.cache/gpt4all/ggml-model-gpt4all-falcon-q4_0.bin
Traceback (most recent call last):
  File "/home/eric/miniconda3/lib/python3.11/site-packages/langchain/llms/llamacpp.py", line 143, in validate_environment
    from llama_cpp import Llama, LlamaGrammar
ImportError: cannot import name 'LlamaGrammar' from 'llama_cpp' (/home/eric/miniconda3/lib/python3.11/site-packages/llama_cpp/__init__.py)