Find answers from the community

Updated 2 years ago

Hi all I am trying to create a GPT

At a glance
Hi all, I am trying to create a GPT labeled dataset by reading a file and getting its summary as my output. I have about 1K files to summarize. Is there a way to pass all at once or do I have to continue looping each time for each file. The prompt for all files is the same. The below is what I have and it seems to combine all the documents into 1

documents = [doc1, doc2]

llm_predictor = LLMPredictor(llm=OpenAI(temperature=0, model_name="gpt-3.5-turbo"))
service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor)

index = GPTSimpleVectorIndex.from_documents(documents, service_context=service_context)
response = index.query("Summarize the following note")
L
1 comment
Right now that's the best way to do it.

I've been meaning to make a PR to make a sort of response_mode="accumulate" option, so that a single prompt as applied across all documents. Haven't had time yet lol
Add a reply
Sign up and join the conversation on Discord