Find answers from the community

Updated 2 years ago

New version issues

no good ... using new version lib(gpt-index 0.5.1) and reindexed doc, still get the same error when query.
L
V
A
26 comments
A lot of changes happened in the new version.

I recommend checking out the docs again to see what changed.

Specifically when creating an index from documents, make sure you do something like GPTSimpleVectorIndex.from_documents(documents)

load documents

documents = SimpleDirectoryReader('input').load_data()

LLM Predictor (gpt-3.5-turbo) + service context

llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo"))
service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, chunk_size_limit=512)
index = GPTSimpleVectorIndex.from_documents(documents, service_context=service_context)
i copied the example...
Can you briefly explain which advantages do new nodes bring to the table? πŸ˜„
maybe it's other requirements lib conflicts between i switch between gpt-index versions... i'll try reinstall it .
Yea, copying the example should work πŸ€”πŸ€”
Mainly it can share nodes between indexes (allows for less data being duplicated, more flexible storage), nodes can model relationships which future indexes/prompts can take advantage of
What do you mean by sharing nodes between indexes?
Before, each index had its own copy of the nodes, stored in an index_struct object.

Now all the nodes are stored in a centralized struct, shared across all the indexes in a composable graph for example
But I thought that also before, in query time, it was possible to get nodes across different indexes! And btw it works also with langchain agents (with llama index as tools)?
But under the hood the node data was duplicated before. And llama index still works as tools uip
hi, i cleared pip packages, reinstalled gpt-index 0.4.32, query still failing...
Traceback (most recent call last):
File "/root/bot-on-anything/channel/wechat/wechat_mp_channel.py", line 159, in reply_text
response = index.query(query, text_qa_template=QA_PROMPT, mode='embedding',response_mode="default",llm_predictor=llm_predictor,prompt_helper=prompt_helper)
File "/usr/local/lib/python3.10/dist-packages/gpt_index/indices/base.py", line 424, in query
return query_runner.query(query_str, self._index_struct)
File "/usr/local/lib/python3.10/dist-packages/gpt_index/indices/query/query_runner.py", line 183, in query
return query_combiner.run(query_obj, query_bundle)
File "/usr/local/lib/python3.10/dist-packages/gpt_index/indices/query/query_combiner/base.py", line 54, in run
return query_obj.query(updated_query_bundle)
File "/usr/local/lib/python3.10/dist-packages/gpt_index/token_counter/token_counter.py", line 86, in wrapped_llm_predict
f_return_val = f(_self, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/gpt_index/indices/query/base.py", line 402, in query
response = self._query(query_bundle)
File "/usr/local/lib/python3.10/dist-packages/gpt_index/indices/query/base.py", line 372, in _query
tuples = self.get_nodes_and_similarities_for_response(query_bundle)
File "/usr/local/lib/python3.10/dist-packages/gpt_index/indices/query/base.py", line 296, in get_nodes_and_similarities_for_response
nodes = self._get_nodes_for_response(
File "/usr/local/lib/python3.10/dist-packages/gpt_index/indices/query/vector_store/base.py", line 45, in _get_nodes_for_response
if query_bundle.embedding is None:
AttributeError: 'list' object has no attribute 'embedding'
this index.json was created about 2 days before, and can be queried well from my laptop, with gpt-index 0.4.32
but not good from ubuntu server 😦
Hmmm. I'm really confused how the query bundle is a list πŸ€”

The OS shouldn't matter here... you used the exact same query code on both Ubuntu and your laptop? And 100% sure it's the same index?
yes, it's the same index file. query is much likely the same
i didn't put "verbose=True" in ubuntu query
all the others are the same
This must be an environment issue still somehow πŸ˜… everything sounds the same 😟

Did you already try re-indexing? (If it's not too expensive anyways)
i tried with gpt-index 0.5.1
the new index got the same error
there is no error during index opration
i cleared pip by: pip freeze | xargs pip uninstall -y
then installed gpt-0.4.32 , ok will deal with it later πŸ™‚ maybe i should start everything all over
Yea that sounds good, like even starting with a new virtual environment would helo maybe?

sorry to hear about the issues! At least it still works on your laptop πŸ˜…
yes, so it will not be a Lib problem, it's my environment problem. should start in a new one. thanks!
Add a reply
Sign up and join the conversation on Discord