OpenICL
OpenICL copied to clipboard
TypeError: 'ListWrapper' object is not iterable
I met:
File "/mnt/sharedata/hdd/zhouxn/ICLCP/group_distance_k.py", line 33, in group_with_distance
retriever = TopkRetriever(data, ice_num=3, batch_size=args.batch_size, index_split='train', test_split='test')
File "/mnt/sharedata/hdd/zhouxn/ICLCP/openicl/icl_retriever/icl_topk_retriever.py", line 78, in __init__
self.index = self.create_index()
File "/mnt/sharedata/hdd/zhouxn/ICLCP/openicl/icl_retriever/icl_topk_retriever.py", line 86, in create_index
res_list = self.forward(dataloader, process_bar=True, information="Creating index for index set...")
File "/mnt/sharedata/hdd/zhouxn/ICLCP/openicl/icl_retriever/icl_topk_retriever.py", line 114, in forward
res_list.extend([{"embed": r, "metadata": m} for r, m in zip(res, metadata)])
TypeError: 'ListWrapper' object is not iterable
I wonder what will cause this error?
I have the same problem, could you please share your solution?
I have the same problem, could you please share your solution?
I have the same problem, could you please share your solution?
Hi, I found that this problem might be caused by the version of environment. In the end, my solution was to run the relevant ICL method in the 'opencompass' project. Opencompass integrates Open-ICL and is continuously maintained, which makes it possible to avoid program environment problems.