def __init__(
        self,
        data_path,
        data_debug_path,
        per_sample_image,
        tokenizer,
        vis_processor=None,
        vis_root=None,
        ann_paths=[],
        add_eos=True,
        ignore_instruction=True,
        sample_image=False,
        annotation_key=None
    ):
        """
        vis_root (string): Root directory of images (e.g. coco/images/)
        ann_root (string): directory to store the annotation file
        """
        if hasattr(tokenizer, "add_eos_token"):
            assert tokenizer.add_eos_token is False, "tokenizer should not add eos token by default"
        self.tokenizer: LlamaTokenizer = tokenizer
        self.data_path = data_path
        self.data_debug_path = data_debug_path
        self.data_debug_counter = 0
        self.vis_root = vis_root
        self.per_sample_image = per_sample_image
        print('check tokenizer',  self.tokenizer)
        self.annotation = []
        for ann_path in ann_paths:
            if annotation_key is None:
                self.annotation.extend(json.load(open(ann_path, "r")))
            else:
                self.annotation.extend(json.load(open(ann_path, "r"))[annotation_key])
        self.sample_image = sample_image
        if self.sample_image:
            print("randomly sample one annotation for each image") 
            self.annotation = self.parse_annotation(self.annotation)

        self.annotation = DST.random_grouping(self.annotation, self.per_sample_image)

        self.vis_processor = vis_processor

        self.option_prob = 0.5
        self.prompter = DST.Prompter()
        self.add_eos = add_eos
        self.ignore_instruction = ignore_instruction
        self.system_instruct = None
        self.image_token_dict = DST.get_image_num_map(self.tokenizer)
        self.cat_number()

        vis_root (string): Root directory of images (e.g. coco/images/)
        ann_root (string): directory to store the annotation file
        
applications/DeepSpeed-VisualChat/utils/data/vqa_dataset.py