I would like to return the following dict type data from DataLoader.
def __getitem__(self, index):
tmp_data = self.benchmark[index]
return {"id": tmp_data["id"],
"question": tmp_data["question"],
"options": tmp_data["options"],
"answer": tmp_data["answer"],
"image": tmp_data["image"],
"question_type": tmp_data["question_type"],
"index2ans": tmp_data["index2ans"],
"correct_choice": tmp_data["correct_choice"],
"all_choices": tmp_data["all_choices"],
"empty_prompt": tmp_data["empty_prompt"],
"final_input_prompt": tmp_data["final_input_prompt"],
"gt_content": tmp_data["gt_content"]}
However, If I implement the loader, this returns None type data.
When I tried to print the return values of getitem, correct values were outputted…