llama_index
llama_index copied to clipboard
GPTChromaIndex indexing fails when documents contains an empty file
trying to index a folder containing an empty document fails when using GPTChromaIndex. reproduced easily by creating an empty doc in a folder of files, and at least by using simpledirectoryreader.
2023-03-21 12:14:31.215 Uncaught app exception
Traceback (most recent call last):
File "/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "/github/ChatObsidian/pages/Index_to_chroma.py", line 106, in
Seems more like a Chroma issue really. but I guess a workaround could be made either client side or on llama index.
Should be a quick fix!
This is fixed in the latest versions of llama-index
>>> from llama_index import GPTVectorStoreIndex, Document
>>> doc = Document('')
>>> index = GPTVectorStoreIndex.from_documents([doc])
>>>
>>> from llama_index import GPTVectorStoreIndex, Document
>>> index = GPTVectorStoreIndex.from_documents([])
>>>