(self, config, tokenizer)
| 142 | return config |
| 143 | |
| 144 | def __init__(self, config, tokenizer): |
| 145 | self.config = self.get_default_config(config) |
| 146 | assert self.config.fields_from_example != '', ( |
| 147 | 'fields_from_example must be specified.' |
| 148 | ) |
| 149 | self.tokenizer = tokenizer |
| 150 | self.vision_start = tokenizer.encode('<vision>') |
| 151 | self.vision_end = tokenizer.encode('</vision>') |
| 152 | |
| 153 | def __call__(self, example, has_aux=False, add_bos_token=True, add_eos_token=True): |
| 154 | if has_aux: |
nothing calls this directly
no test coverage detected