You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For notebooks in 05_Semantic_Search_with_Reranking, when calling get_retrieved_nodes() with with_reranker=True, got IndexError: list index out of range.
Detailed error message:
For notebooks in 05_Semantic_Search_with_Reranking, when calling get_retrieved_nodes() with with_reranker=True, got IndexError: list index out of range.
Detailed error message:
IndexError Traceback (most recent call last)
Cell In[26], line 1
----> 1 retrieved_nodes1_withreranker = get_retrieved_nodes(
2 "How has AWS evolved?",
3 vector_top_k=1,
4 reranker_top_n=1,
5 with_reranker=True,
6 )
Cell In[22], line 30, in get_retrieved_nodes(query_str, vector_top_k, reranker_top_n, with_reranker)
21 if with_reranker:
22 # configure reranker
23 reranker = LLMRerank(
24 choice_batch_size=10, # 5,
25 top_n=reranker_top_n,
(...)
28
29 )
---> 30 retrieved_nodes = reranker.postprocess_nodes(retrieved_nodes, query_bundle)
32 return retrieved_nodes
File /opt/conda/lib/python3.10/site-packages/llama_index/indices/postprocessor/llm_rerank.py:85, in LLMRerank.postprocess_nodes(self, nodes, query_bundle)
78 # call each batch independently
79 raw_response = self.service_context.llm_predictor.predict(
80 self.choice_select_prompt,
81 context_str=fmt_batch_str,
82 query_str=query_str,
83 )
---> 85 raw_choices, relevances = self._parse_choice_select_answer_fn(
86 raw_response, len(nodes_batch)
87 )
88 choice_idxs = [int(choice) - 1 for choice in raw_choices]
89 choice_nodes = [nodes_batch[idx] for idx in choice_idxs]
File /opt/conda/lib/python3.10/site-packages/llama_index/indices/utils.py:104, in default_parse_choice_select_answer_fn(answer, num_choices, raise_error)
98 else:
99 raise ValueError(
100 f"Invalid answer line: {answer_line}. "
101 "Answer line must be of the form: "
102 "answer_num: , answer_relevance: "
103 )
--> 104 answer_num = int(line_tokens[0].split(":")[1].strip())
105 if answer_num > num_choices:
106 continue
IndexError: list index out of range
The text was updated successfully, but these errors were encountered: