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