Skip to content

Can't get ingest_code.py to run #9

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

Open
sbowman opened this issue Feb 26, 2025 · 0 comments
Open

Can't get ingest_code.py to run #9

sbowman opened this issue Feb 26, 2025 · 0 comments

Comments

@sbowman
Copy link

sbowman commented Feb 26, 2025

If I try to build this using Python 3.12, it doesn't work:

Collecting gevent<23.0.0,>=22.10.2 (from chainlit->-r requirements.txt (line 4))
  Using cached gevent-22.10.2.tar.gz (6.6 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
...

I can get 3.12 to work by setting a version for chainlit in requirements.txt:

chainlit > 1

Alternatively I can use Python 3.9 (or 3.10) and everything will install as is (no modifications to requirements.txt).

However, in either case, I get an error like this when trying to run ingest-code.py:

Traceback (most recent call last):
  File "/Users/sbowman/projects/rag_time/ingest-code.py", line 84, in <module>
    create_vector_database()
  File "/Users/sbowman/projects/rag_time/ingest-code.py", line 36, in create_vector_database
    chunked_documents.extend(chunk_code())
  File "/Users/sbowman/projects/rag_time/ingest-code.py", line 61, in chunk_code
    loaded_documents = loader.load()
  File "/Users/sbowman/projects/rag_time/.venv-rag-time/lib/python3.9/site-packages/langchain_core/document_loaders/base.py", line 31, in load
    return list(self.lazy_load())
  File "/Users/sbowman/projects/rag_time/.venv-rag-time/lib/python3.9/site-packages/langchain_community/document_loaders/generic.py", line 116, in lazy_load
    yield from self.blob_parser.lazy_parse(blob)
  File "/Users/sbowman/projects/rag_time/.venv-rag-time/lib/python3.9/site-packages/langchain_community/document_loaders/parsers/language/language_parser.py", line 195, in lazy_parse
    code = blob.as_string()
  File "/Users/sbowman/projects/rag_time/.venv-rag-time/lib/python3.9/site-packages/langchain_core/documents/base.py", line 153, in as_string
    return f.read()
  File "/Users/sbowman/.pyenv/versions/3.9.21/lib/python3.9/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
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