Git Product home page Git Product logo

talk-codebase's People

Contributors

dependabot[bot] avatar mearman avatar rsaryev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

talk-codebase's Issues

Cant seem to get it to work.

tyron@Tyrons-Air ~ % talk-codebase chat .
๐Ÿค– Config path: /Users/tyron/.talk_codebase_config.yaml:
Found model file at /Users/tyron/.cache/gpt4all/ggml-wizardLM-7B.q4_2.bin
llama.cpp: loading model from /Users/tyron/.cache/gpt4all/ggml-wizardLM-7B.q4_2.bin
error loading model: unrecognized tensor type 4

llama_load_model_from_file: failed to load model
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/bin/talk-codebase", line 8, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/talk_codebase/cli.py", line 55, in main
raise e
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/talk_codebase/cli.py", line 48, in main
fire.Fire({
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/talk_codebase/cli.py", line 41, in chat
llm = factory_llm(root_dir, config)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/talk_codebase/llm.py", line 118, in factory_llm
return LocalLLM(root_dir, config)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/talk_codebase/llm.py", line 23, in init
self.llm = self._create_model()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/talk_codebase/llm.py", line 96, in _create_model
llm = LlamaCpp(model_path=model_path, n_ctx=model_n_ctx, n_batch=model_n_batch, callbacks=callbacks, verbose=False)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/langchain/load/serializable.py", line 74, in init
super().init(**kwargs)
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for LlamaCpp
root
Could not load Llama model from path: /Users/tyron/.cache/gpt4all/ggml-wizardLM-7B.q4_2.bin. Received error (type=value_error)
Exception ignored in: <function Llama.del at 0x11d5db9a0>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/llama_cpp/llama.py", line 1445, in del
if self.ctx is not None:
AttributeError: 'Llama' object has no attribute 'ctx'

No License

This code has no license yet. Consider adding one.

Failed to load model

Failed to load model. Logs below

๐Ÿค– Config path: /Users/mf412833/.talk_codebase_config.yaml:
? ๐Ÿค– Select model type: Local
? ๐Ÿค– Select model name: Llama-2-7B Chat | llama-2-7b-chat.ggmlv3.q4_0.bin | 3791725184 | 7 billion | q4_0 | LLaMA2
๐Ÿค– Model name saved!
100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 3.79G/3.79G [03:30<00:00, 18.0MiB/s]
Model downloaded at: /Users/mf412833/.cache/gpt4all/llama-2-7b-chat.ggmlv3.q4_0.bin
gguf_init_from_file: invalid magic characters 'tjgg'
llama_model_load: error loading model: llama_model_loader: failed to load model from /Users/mf412833/.cache/gpt4all/llama-2-7b-chat.ggmlv3.q4_0.bin

llama_load_model_from_file: failed to load model
Traceback (most recent call last):
File "/Users/mf412833/.pyenv/versions/3.10.0/bin/talk-codebase", line 8, in
sys.exit(main())
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/talk_codebase/cli.py", line 70, in main
raise e
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/talk_codebase/cli.py", line 63, in main
fire.Fire({
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/talk_codebase/cli.py", line 55, in chat
llm = factory_llm(repo.working_dir, config)
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/talk_codebase/llm.py", line 125, in factory_llm
return LocalLLM(root_dir, config)
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/talk_codebase/llm.py", line 24, in init
self.llm = self._create_model()
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/talk_codebase/llm.py", line 101, in _create_model
llm = LlamaCpp(model_path=model_path, n_ctx=model_n_ctx, n_batch=model_n_batch, callbacks=callbacks,
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/langchain/load/serializable.py", line 97, in init
super().init(**kwargs)
File "/Users/mf412833/.pyenv/versions/3.10.0/lib/python3.10/site-packages/pydantic/v1/main.py", line 341, in init
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for LlamaCpp
root
Could not load Llama model from path: /Users/mf412833/.cache/gpt4all/llama-2-7b-chat.ggmlv3.q4_0.bin. Received error Failed to load model from file: /Users/mf412833/.cache/gpt4all/llama-2-7b-chat.ggmlv3.q4_0.bin (type=value_error)

Creating vector store for documents error

Traceback (most recent call last):
File "/Users/tim/anaconda3/envs/local/bin/talk-codebase", line 8, in
โ น Creating vector store for 2770 documents sys.exit(main())
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/cli.py", line 98, in main
raise e
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/cli.py", line 88, in main
fire.Fire({
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/cli.py", line 82, in chat
llm = factory_llm(root_dir, config)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/LLM.py", line 106, in factory_llm
return OpenAILLM(root_dir, config)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/LLM.py", line 24, in init
self.vector_store = self._create_store(root_dir)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/LLM.py", line 95, in _create_store
return self._create_vector_store(embeddings, MODEL_TYPES["OPENAI"], root_dir)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/talk_codebase/LLM.py", line 74, in _create_vector_store
db = FAISS.from_documents(texts, embeddings)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 317, in from_documents
return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 502, in from_texts
return cls.__from(
File "/Users/tim/anaconda3/envs/local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 454, in __from
vector = np.array(embeddings, dtype=np.float32)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5951,) + inhomogeneous part.

openai.error.RateLimitError

I'm getting this error:

? Creating a vector store will cost ~$0.35806. Do you want to continue? Yes
โ น Creating vector storeRetrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for default-text-embedding-ada-002 in organization org-xxxx on tokens per min. Limit: 150000 / min. Current: 1 / min. Contact us through our help center at help.openai.com if you continue to have issues..
โ ผ Creating vector storeRetrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for default-text-embedding-ada-002 in organization org-xxxx on tokens per min. Limit: 150000 / min. Current: 1 / min. Contact us through our help center at help.openai.com if you continue to have issues..
โ ง Creating vector storeRetrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised RateLimitError: Rate limit reached for default-text-embedding-ada-002 in organization org-xxxx on tokens per min. Limit: 150000 / min. Current: 1 / min. Contact us through our help center at help.openai.com if you continue to have issues..
โ ง Creating vector storeRetrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 8.0 seconds as it raised RateLimitError: Rate limit reached for default-text-embedding-ada-002 in organization org-xxxx on tokens per min. Limit: 150000 / min. Current: 0 / min. Contact us through our help center at help.openai.com if you continue to have issues..
โ  Creating vector storeRetrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 10.0 seconds as it raised RateLimitError: Rate limit reached for default-text-embedding-ada-002 in organization org-xxxx on tokens per min. Limit: 150000 / min. Current: 1 / min. Contact us through our help center at help.openai.com if you continue to have issues..
โ ฆ Creating vector storeTraceback (most recent call last):
File "/home/codespace/.python/current/bin/talk-codebase", line 8, in
sys.exit(main())
File "/opt/python/3.10.8/lib/python3.10/site-packages/talk_codebase/cli.py", line 65, in main
raise e
File "/opt/python/3.10.8/lib/python3.10/site-packages/talk_codebase/cli.py", line 58, in main
fire.Fire({
File "/opt/python/3.10.8/lib/python3.10/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/opt/python/3.10.8/lib/python3.10/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/opt/python/3.10.8/lib/python3.10/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/opt/python/3.10.8/lib/python3.10/site-packages/talk_codebase/cli.py", line 50, in chat
llm = factory_llm(root_dir, config)
File "/opt/python/3.10.8/lib/python3.10/site-packages/talk_codebase/llm.py", line 117, in factory_llm
return OpenAILLM(root_dir, config)
File "/opt/python/3.10.8/lib/python3.10/site-packages/talk_codebase/llm.py", line 25, in init
self.vector_store = self._create_store(root_dir)
File "/opt/python/3.10.8/lib/python3.10/site-packages/talk_codebase/llm.py", line 104, in _create_store
return self._create_vector_store(embeddings, MODEL_TYPES["OPENAI"], root_dir)
File "/opt/python/3.10.8/lib/python3.10/site-packages/talk_codebase/llm.py", line 63, in _create_vector_store
db = FAISS.from_documents(texts, embeddings)
File "/opt/python/3.10.8/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 402, in from_documents
return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
File "/opt/python/3.10.8/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 567, in from_texts
embeddings = embedding.embed_documents(texts)
File "/opt/python/3.10.8/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 508, in embed_documents
return self._get_len_safe_embeddings(texts, engine=self.deployment)
File "/opt/python/3.10.8/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 358, in _get_len_safe_embeddings
response = embed_with_retry(
File "/opt/python/3.10.8/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 108, in embed_with_retry
return _embed_with_retry(**kwargs)
File "/home/codespace/.local/lib/python3.10/site-packages/tenacity/init.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "/home/codespace/.local/lib/python3.10/site-packages/tenacity/init.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "/home/codespace/.local/lib/python3.10/site-packages/tenacity/init.py", line 325, in iter
raise retry_exc.reraise()
File "/home/codespace/.local/lib/python3.10/site-packages/tenacity/init.py", line 158, in reraise
raise self.last_attempt.result()
File "/opt/python/3.10.8/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/opt/python/3.10.8/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/home/codespace/.local/lib/python3.10/site-packages/tenacity/init.py", line 382, in call
result = fn(*args, **kwargs)
File "/opt/python/3.10.8/lib/python3.10/site-packages/langchain/embeddings/openai.py", line 105, in _embed_with_retry
response = embeddings.client.create(**kwargs)
File "/opt/python/3.10.8/lib/python3.10/site-packages/openai/api_resources/embedding.py", line 33, in create
response = super().create(*args, **kwargs)
File "/opt/python/3.10.8/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/opt/python/3.10.8/lib/python3.10/site-packages/openai/api_requestor.py", line 298, in request
resp, got_stream = self._interpret_response(result, stream)
File "/opt/python/3.10.8/lib/python3.10/site-packages/openai/api_requestor.py", line 700, in _interpret_response
self._interpret_response_line(
File "/opt/python/3.10.8/lib/python3.10/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: Rate limit reached for default-text-embedding-ada-002 in organization org-xxx on tokens per min. Limit: 150000 / min. Current: 1 / min. Contact us through our help center at help.openai.com if you continue to have issues.

Ideas on this error?

Hi, after saying "Creating vector store will cost.... continue?" I get the following:

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (1446,) + inhomogeneous part

Any thoughts on why this might be?

Use optional dependency group for local LLMs

The size of dependencies for this project is enormous:

$ du -hs venv
5.6G    venv

It also took several minutes to install.

I only want to use hosted models. Can the dependencies for local models be added to an optional dependency group (e.g. pip install talk-codebase[local])? I imagine the dependencies for hosted models would be a few MB.

Git repository not found

I installed it under wsl2 oobabooga on windows 10 and when I select a local model it gives and error "Git repository not found". It is a little cryptic what the problem is. I deleted the yaml file it made and tried it again by selecting another model and I get the same error.

root@main-pc:# talk-codebase chat ./
๐Ÿค– Config path: /root/.talk_codebase_config.yaml:
? ๐Ÿค– Select model type: Local
? ๐Ÿค– Select model name: Llama-2-7B Chat | llama-2-7b-chat.ggmlv3.q4_0.bin | 3791725184 | 7 billion | q4_0 | LLaMA2
๐Ÿค– Model name saved!
๐Ÿค– Git repository not found
root@main-pc:
# talk-codebase chat ./
๐Ÿค– Config path: /root/.talk_codebase_config.yaml:
๐Ÿค– Git repository not found
root@main-pc:# pico /root/.talk_codebase_config.yaml
root@main-pc:
# rm /root/.talk_codebase_config.yaml
root@main-pc:# talk-codebase chat ./
๐Ÿค– Config path: /root/.talk_codebase_config.yaml:
? ๐Ÿค– Select model type: Local
? ๐Ÿค– Select model name: GPT4All Falcon | ggml-model-gpt4all-falcon-q4_0.bin | 4061641216 | 7 billion | q4_0 | Falcon
๐Ÿค– Model name saved!
๐Ÿค– Git repository not found
root@main-pc:
#

Not working.

Hi, there.
I followed your project's instruction to install from pip install talk-codebase and configured with OpenAI. Everything seems well until it's broken when I run talk-codebase chat . under this project :

๐Ÿ“‚ Loading files: ./README.md
๐Ÿ“‚ Loading files: ./talk_codebase/Code Explaination.md
๐Ÿ“‚ Loading files: ./talk_codebase/all_code.md
๐Ÿ“‚ Loading files: ./talk_codebase/config.py
๐Ÿ“‚ Loading files: ./talk_codebase/__init__.py
๐Ÿ“‚ Loading files: ./talk_codebase/llm.py
๐Ÿ“‚ Loading files: ./talk_codebase/consts.py
๐Ÿ“‚ Loading files: ./talk_codebase/cli.py
๐Ÿ“‚ Loading files: ./talk_codebase/utils.py
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/langchain/document_loaders/unstructured.py", line 71, in load
    elements = self._get_elements()
               ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/langchain/document_loaders/markdown.py", line 12, in _get_elements
    from unstructured.partition.md import partition_md
  File "/opt/homebrew/lib/python3.11/site-packages/unstructured/partition/md.py", line 10, in <module>
    from unstructured.partition.html import partition_html
  File "/opt/homebrew/lib/python3.11/site-packages/unstructured/partition/html.py", line 6, in <module>
    from unstructured.documents.html import HTMLDocument
  File "/opt/homebrew/lib/python3.11/site-packages/unstructured/documents/html.py", line 25, in <module>
    from unstructured.partition.text_type import (
  File "/opt/homebrew/lib/python3.11/site-packages/unstructured/partition/text_type.py", line 21, in <module>
    from unstructured.nlp.tokenize import pos_tag, sent_tokenize, word_tokenize
  File "/opt/homebrew/lib/python3.11/site-packages/unstructured/nlp/tokenize.py", line 32, in <module>
    _download_nltk_package_if_not_present(package_name, package_category)
  File "/opt/homebrew/lib/python3.11/site-packages/unstructured/nlp/tokenize.py", line 21, in _download_nltk_package_if_not_present
    nltk.find(f"{package_category}/{package_name}")
  File "/opt/homebrew/lib/python3.11/site-packages/nltk/data.py", line 555, in find
    return find(modified_name, paths)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/nltk/data.py", line 542, in find
    return ZipFilePathPointer(p, zipentry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/nltk/compat.py", line 41, in _decorator
    return init_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/nltk/data.py", line 394, in __init__
    zipfile = OpenOnDemandZipFile(os.path.abspath(zipfile))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/nltk/compat.py", line 41, in _decorator
    return init_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/nltk/data.py", line 935, in __init__
    zipfile.ZipFile.__init__(self, filename)
  File "/opt/homebrew/Cellar/[email protected]/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/zipfile.py", line 1302, in __init__
    self._RealGetContents()
  File "/opt/homebrew/Cellar/[email protected]/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/zipfile.py", line 1369, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
"""

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

Traceback (most recent call last):
  File "/opt/homebrew/bin/talk-codebase", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/talk_codebase/cli.py", line 55, in main
    raise e
  File "/opt/homebrew/lib/python3.11/site-packages/talk_codebase/cli.py", line 48, in main
    fire.Fire({
  File "/opt/homebrew/lib/python3.11/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/fire/core.py", line 475, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
                                ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/talk_codebase/cli.py", line 41, in chat
    llm = factory_llm(root_dir, config)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/talk_codebase/llm.py", line 116, in factory_llm
    return OpenAILLM(root_dir, config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/talk_codebase/llm.py", line 25, in __init__
    self.vector_store = self._create_store(root_dir)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/talk_codebase/llm.py", line 103, in _create_store
    return self._create_vector_store(embeddings, MODEL_TYPES["OPENAI"], root_dir)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/talk_codebase/llm.py", line 43, in _create_vector_store
    docs = load_files(root_dir)
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/talk_codebase/utils.py", line 62, in load_files
    docs.extend(future.get())
                ^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.4/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 774, in get
    raise self._value
zipfile.BadZipFile: File is not a zip file

Installation failed expected_node_count Assertion error

Following Installation section of readme, ran pip install talk-codebase inside a venv.

Environment details:

  1. python 3.8.18
  2. No NVIDIA GPU in machine

Error message:

Collecting mdurl~=0.1
  Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Using legacy 'setup.py install' for fire, since package 'wheel' is not installed.
Using legacy 'setup.py install' for halo, since package 'wheel' is not installed.
Using legacy 'setup.py install' for sentence-transformers, since package 'wheel' is not installed.
ERROR: Exception:
Traceback (most recent call last):
  File "/home/ncdejito/Downloads/navigation2/venv/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 165, in exc_logging_wrapper
    status = run_func(*args)
  File "/home/ncdejito/Downloads/navigation2/venv/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "/home/ncdejito/Downloads/navigation2/venv/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 389, in run
    to_install = resolver.get_installation_order(requirement_set)
  File "/home/ncdejito/Downloads/navigation2/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 188, in get_installation_order
    weights = get_topological_weights(
  File "/home/ncdejito/Downloads/navigation2/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 276, in get_topological_weights
    assert len(weights) == expected_node_count
AssertionError

cannot import name 'LlamaGrammar' from 'llama_cpp'

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)

It can't understand the code with ChatGPT(GPT3.5)

Here's the chat about the talk-codebase repo.

talk_codebase git:(main) โœ— talk-codebase chat ./  
๐Ÿค– Config path: /Users/fengg/.talk_codebase_config.yaml:
๐Ÿ‘‰ what is the process of the user's input question be answered?
๐Ÿค– Unfortunately, I cannot provide a complete answer as the code you provided is incomplete. However, based on the code provided, it seems that the CONFIGURE_STEPS list contains a series of functions that configure different aspects of the model and the environment in which it runs. These functions are called in sequence to obtain the necessary information to answer the user's question. The user's input question is not present in this code, so it is unclear how it is processed and answered.
๐Ÿ“„ /Users/fengg/fflab/talk-codebase/talk_codebase/config.py:

error after selecting local starcoderbase-3b

(.venv) aloha11:talk-codebase liao6$ rm /Users/liao6/.cache/gpt4all/starcoderbase-3b-ggml.bin
(.venv) aloha11:talk-codebase liao6$ talk-codebase chat .
๐Ÿค– Config path: /Users/liao6/.talk_codebase_config.yaml:
100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 7.50G/7.50G [12:42<00:00, 9.84MiB/s]
Model downloaded at:  /Users/liao6/.cache/gpt4all/starcoderbase-3b-ggml.bin
llama.cpp: loading model from /Users/liao6/.cache/gpt4all/starcoderbase-3b-ggml.bin
error loading model: unexpectedly reached end of file
llama_load_model_from_file: failed to load model
Traceback (most recent call last):
  File "/Users/liao6/workspace/talk-codebase/.venv/bin/talk-codebase", line 8, in <module>
    sys.exit(main())
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/talk_codebase/cli.py", line 55, in main
    raise e
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/talk_codebase/cli.py", line 48, in main
    fire.Fire({
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/fire/core.py", line 475, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/talk_codebase/cli.py", line 41, in chat
    llm = factory_llm(root_dir, config)
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/talk_codebase/llm.py", line 118, in factory_llm
    return LocalLLM(root_dir, config)
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/talk_codebase/llm.py", line 23, in __init__
    self.llm = self._create_model()
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/talk_codebase/llm.py", line 96, in _create_model
    llm = LlamaCpp(model_path=model_path, n_ctx=model_n_ctx, n_batch=model_n_batch, callbacks=callbacks, verbose=False)
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/langchain/load/serializable.py", line 74, in __init__
    super().__init__(**kwargs)
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for LlamaCpp
__root__
  Could not load Llama model from path: /Users/liao6/.cache/gpt4all/starcoderbase-3b-ggml.bin. Received error  (type=value_error)
Exception ignored in: <function Llama.__del__ at 0x128393a60>
Traceback (most recent call last):
  File "/Users/liao6/workspace/talk-codebase/.venv/lib/python3.9/site-packages/llama_cpp/llama.py", line 1445, in __del__
    if self.ctx is not None:
AttributeError: 'Llama' object has no attribute 'ctx'

llama_print_timings: .. lines show up before the last word of the answer

Model selected is Mini Orca (Small) | orca-mini-3b.ggmlv3.q4_0.bin | 1928446208 | 3 billion | q4_0 | OpenLLaMa

๐Ÿ‘‰ what does this code do?
๐Ÿค–  The given code creates a BaseLLM object which is an implementation of linearized language models for text classification tasks. It also calls the `embedding_search` method to search for similar vectors using a given query and a search range. Finally, it loads the vector store with the specified embeddings, index, and root directory and returns the corresponding vector based on the search
llama_print_timings:        load time =   493.57 ms
llama_print_timings:      sample time =    60.73 ms /    78 runs   (    0.78 ms per token,  1284.44 tokens per second)
llama_print_timings: prompt eval time = 21908.13 ms /   602 tokens (   36.39 ms per token,    27.48 tokens per second)
llama_print_timings:        eval time =  6591.89 ms /    77 runs   (   85.61 ms per token,    11.68 tokens per second)
llama_print_timings:       total time = 28967.39 ms
 range.
๐Ÿ“„ /Users/liao6/workspace/talk-codebase/talk_codebase/llm.py:

As you can see, the timing information is injected before the last word of the answer "range."

llama_print_timings:        load time =   493.57 ms
llama_print_timings:      sample time =    60.73 ms /    78 runs   (    0.78 ms per token,  1284.44 tokens per second)
llama_print_timings: prompt eval time = 21908.13 ms /   602 tokens (   36.39 ms per token,    27.48 tokens per second)
llama_print_timings:        eval time =  6591.89 ms /    77 runs   (   85.61 ms per token,    11.68 tokens per second)
llama_print_timings:       total time = 28967.39 ms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.