Find answers from the community

Updated 2 years ago

jerryjliu98 9313 a heads up from llama

At a glance
@jerryjliu0 a heads up: from llama_index import document doesn't work with GPTSimpleVectorIndex while from gpt_index import document works
j
L
13 comments
oh weird, what's the error?
text_list = data['Combined'][0:100].tolist()
documents = [Document(t) for t in text_list]
index = GPTSimpleVectorIndex(documents)
wrong document type if I use llama_index
import document
but works with gpt_index import document
thanks - will take a look
could you post the stack trace?
sorry was away
Output exceeds the size limit. Open the full output data in a text editor
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
c:\Users\Leon\Desktop\Cognizant\Desktop App\Cognizant\src\Integrating-ChatGPT.ipynb Cell 10 in 1
----> 1 index = GPTSimpleVectorIndex(documents)

File c:\Program Files\Python 3.9\lib\site-packages\gpt_index\indices\vector_store\vector_indices.py:83, in GPTSimpleVectorIndex.init(self, documents, index_struct, text_qa_template, llm_predictor, embed_model, simple_vector_store_data_dict, kwargs) 78 """Init params.""" 79 vector_store = SimpleVectorStore( 80 simple_vector_store_data_dict=simple_vector_store_data_dict 81 )---> 83 super().init( 84 documents=documents, 85 index_struct=index_struct, 86 text_qa_template=text_qa_template, 87 llm_predictor=llm_predictor, 88 embed_model=embed_model, 89 vector_store=vector_store, 90 kwargs,
91 )
93 # TODO: Temporary hack to also store embeddings in index_struct
94 embedding_dict = vector_store._data.embedding_dict

File c:\Program Files\Python 3.9\lib\site-packages\gpt_index\indices\vector_store\base.py:62, in GPTVectorStoreIndex.init(self, documents, index_struct, text_qa_template, llm_predictor, embed_model, vector_store, text_splitter, use_async, **kwargs)
60 self.text_qa_template = text_qa_template or DEFAULT_TEXT_QA_PROMPT
61 self._use_async = use_async
...
180 else:
--> 181 raise ValueError(f"Invalid document type: {type(doc)}.")
182 return cast(List[BaseDocument], results)

ValueError: Invalid document type: .
separate question: why does GPTSimpleVectorIndex take so much longer than normal openai embeddings?
Add a reply
Sign up and join the conversation on Discord