| 126 | class VisionTextProcessor(object): |
| 127 | @staticmethod |
| 128 | def get_default_config(updates=None): |
| 129 | config = ConfigDict() |
| 130 | config.fields_from_example = '' |
| 131 | config.subfield_separator = ' ' |
| 132 | config.add_bos_token = True |
| 133 | config.add_eos_token = True |
| 134 | config.prepend_text = '' |
| 135 | config.fields_index = -1 |
| 136 | config.eof_token = 8192 # denotes end of each frame for video generation |
| 137 | config.eov_token = 8193 # denotes end of vision generation |
| 138 | config.n_tokens_per_frame = 256 # 16 x 16 VQ codes |
| 139 | config.max_n_frames = -1 |
| 140 | if updates is not None: |
| 141 | config.update(ConfigDict(updates).copy_and_resolve_references()) |
| 142 | return config |
| 143 | |
| 144 | def __init__(self, config, tokenizer): |
| 145 | self.config = self.get_default_config(config) |