Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to ignore files #7

Open
tmm1 opened this issue Jul 13, 2023 · 0 comments
Open

Add a way to ignore files #7

tmm1 opened this issue Jul 13, 2023 · 0 comments

Comments

@tmm1
Copy link

tmm1 commented Jul 13, 2023

I tried clara on a couple projects and run into errors in the document loading process.

           Loading node_modules/ipaddr.js …                              
Traceback (most recent call last):                                                                                         
  File "/opt/homebrew/lib/python3.10/site-packages/langchain/document_loaders/text.py", line 40, in load
    with open(self.file_path, encoding=self.encoding) as f:                                                                
IsADirectoryError: [Errno 21] Is a directory: 'node_modules/ipaddr.js'
                                                                                                                                                                                             
  File "/opt/homebrew/lib/python3.10/site-packages/clara/cli.py", line 30, in setup   
    index.ingest()
  File "/opt/homebrew/lib/python3.10/site-packages/clara/index.py", line 73, in ingest 
    texts = self._get_texts()
  File "/opt/homebrew/lib/python3.10/site-packages/clara/index.py", line 53, in _get_texts
    documents.extend(loader.load_and_split())
  File "/opt/homebrew/lib/python3.10/site-packages/langchain/document_loaders/base.py", line 43, in load_and_split
    docs = self.load()
  File "/opt/homebrew/lib/python3.10/site-packages/langchain/document_loaders/text.py", line 56, in load
    raise RuntimeError(f"Error loading {self.file_path}") from e
RuntimeError: Error loading /Users/tmm1/fancybits/chrome-capture-for-channels/node_modules/ipaddr.js
           Loading ext/libhdhomerun/README.md …                           index.py:51
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/langchain/document_loaders/text.py", line 41, in load
    text = f.read()
  File "/opt/homebrew/Cellar/[email protected]/3.10.12/Frameworks/Python.framework/Versions/3.10/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 10: invalid start byte

If there was a way to specify directories to ignore, I could tell it to stop traversing into directories like node_modules, vendor/gems and ext in these projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant