Find answers from the community

s
F
Y
a
P
Updated 2 years ago

```

Plain Text
    graph = ComposableGraph.from_indices(
        GPTListIndex,
        index_arr,
        index_summaries=summaries,
        service_context=service_context
    )

Hi when I add service_context to ComposableGraph.from_indices I always get this error ValueError: Got a larger chunk overlap (20) than chunk size (-42), should be smaller.

This is my service_context:
Plain Text
# set maximum input size
max_input_size = 256
# set number of output tokens
num_outputs = 256
# set maximum chunk overlap
max_chunk_overlap = 20

chunk_size_limit = 512
# define LLM
llm_predictor = LLMPredictor(llm=OpenAI(temperature=0.2, model_name="gpt-3.5-turbo", max_tokens=num_outputs))
prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit)
service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, prompt_helper=prompt_helper, chunk_size_limit=chunk_size_limit)
L
J
j
9 comments
max input size and num outputs cant be the same. And your chunk size limit can't be larger than max_input_size - num_outputs πŸ€”

You can probably leave max_input_size at the default of 4096?
sure thanks
By the way, I found when I query on a graph. I found the first source node does not exist in my index and contain no extra_info:
Plain Text
"node": {
                "doc_hash": "0a180da7ad7e872339c4f540e2294aee772b5d1e1998f51f56017e37feaff6be",
                "doc_id": "c7d1c2f6-5a60-4108-9e6e-d5a48bcb6414",
                "embedding": null,
                "extra_info": null,
                "node_info": null,
                "relationships": {},
                "text": "- Transition to a clea..."
}
and the doc_id does not exist in my index. However, other source_nodes are correct:
Plain Text
"extra_info": {
                    "keywords": "stock, 10K, SEC, company, financials",
                    "ticker": "MSFT",
                    "type": "10K SEC Filing",
                    "year": "2022"
                },
I think that first source node is the summary of the sub index? Not sure πŸ€”
It seems the first source node is same to response.
Maybe a weird quirk with graphs? @jerryjliu0 for some reason the first source node in a graph query seems to be the response?
@JW hm yeah we also include "intermediate" nodes as source nodes
e.g. the source node is the "summary" node corresponding to your index
Add a reply
Sign up and join the conversation on Discord