Find answers from the community

Updated 2 months ago

Refine bug?

the refine template not update in the iteration, i debuged it,so i think refine template not re use previous answer
L
n
8 comments
Give me a few minutes and I'll try stepping through with pdb
ok i have some confuse with this
If you set a break point around here, you can step through the code: https://github.com/jerryjliu/llama_index/blob/main/gpt_index/indices/response/builder.py#L128

if you check before/after every predict call in the loop on line 137, you can see the refine update always has the previous response

print(refine_template.partial_dict) will show the existing_answer variable changes on every loop
there's some pass-by-reference magic happening here, it's a little hard to follow
I'll reconfirm it. Thank you
Actually, looking at it further, I think I'm wrong 😅

For every "node" it's updating with the previous response

But if a single node is broken into multiple chunks, the previous answer is not tracked properly 🤔 it should be updated at the end of every loop over the text chunks

Very sneaky! I think it might actually be a bug. I'll submit a PR for this (unless you want to!)
yes yes ,we should fix it
This fix is in the latest release btw! (Just making sure you saw)
Add a reply
Sign up and join the conversation on Discord