OFA-Sys / OFA

Official repository of OFA (ICML 2022). Paper: OFA: Unifying Architectures, Tasks, and Modalities Through a Simple Sequence-to-Sequence Learning Framework
Apache License 2.0
2.39k stars 248 forks source link

max_tgt_length is not used in data/mm_data/vqa_gen_dataset.py #412

Open yuezhao238 opened 1 year ago

yuezhao238 commented 1 year ago

Hi! Thank you for this great work! I think there is a small bug in data/mm_data/vqa_gen_dataset.py. When getitem in the dataset, it looks like you forget to set the max_tgt_length. When the answers are very long, CUDA error will raise. So I changed code in line163, ref_dict = {item.split('|!+')[1]: float(item.split('|!+')[0]) for item in ref.split('&&')} -> ref_dict = {item.split('|!+')[1][:self.max_tgt_length]: float(item.split('|!+')[0]) for item in ref.split('&&')}. And in my cases, it made sense. Thank you for your precious time!

logicwong commented 12 months ago

@Heathcliff-Zhao Thank you for your feedback. I will fix this bug.