Find answers from the community

Updated last year

Key error

Hey team, We are migrating to version 0.8.36 from an older version. We have successfully migrated to the version except the following issue. It seems that the Dataset Generator used to work for the older version. But it's breaking on the version 0.8.36. Sharing the details of error and code snippet below.

Code Snippet:
Plain Text
## document_chunks is of the following typehints: List[Document]
## For example: document_chunks = [
## Document(id_='651ee77f9e9ad9292457dce8', embedding=None, metadata={...}, excluded_embed_metadata_keys=[],
## excluded_llm_metadata_keys=[], relationships={}, hash='6a1ed207bcccfea219f5d4b9fe764aa70bac565518c17865804b3505d6a4c2bb', ## text="...", start_char_idx=None, end_char_idx=None, text_template='{metadata_str}\n\n{content}', 
## metadata_template='{key}: {value}', metadata_seperator='\n'),
## ...,]

data_generator = DatasetGenerator.from_documents(
            documents=document_chunks,
            service_context=service_context,
        )
questions = data_generator.generate_questions_from_nodes(num=NUM_QUESTIONS)


The error we started to face from the above code (The same code used to work with earlier versions)
Plain Text
File "/lib/python3.10/site-packages/llama_index/evaluation/dataset_generation.py", line 252, in <dictcomp>
    query_id: responses_dict[query_id] for query_id in query_ids

Any help on the above issue^ @Logan M / @ravitheja?
Thanks
L
A
3 comments
This was fixed in newer versions -- 0.8.37 I think actually
Nice..Thanks for the info, Giving it a try
Thanks Logan, It worked with llama-index==0.8.38
Add a reply
Sign up and join the conversation on Discord