IndexError: list index out of range when call load_summarize_chain using PALM2

222 views Asked by At

I've been struggling to solve this error for hours with no luck. I'm trying to summarize files after splitting to chunks them using the PALM model. my code

refine_chain = load_summarize_chain(
    llm,
    chain_type="refine",
    ......
)
text_splitter = CharacterTextSplitter(
    separator = "\n",
    chunk_size = 1000,
    chunk_overlap  = 0)

document_chunks = text_splitter.split_documents(documents)
refine_outputs = refine_chain({"input_documents": document_chunks})

the error: ----> 7 refine_outputs = refine_chain({"input_documents": document_chunks})

10 frames /usr/local/lib/python3.10/dist-packages/langchain_core/output_parsers/base.py in parse_result(self, result, partial) 220 Structured output. 221 """ --> 222 return self.parse(result[0].text) 223 224 @abstractmethod

IndexError: list index out of range.

anyone help please?

0

There are 0 answers