(meta_l: List[Dict])
| 230 | |
| 231 | @ staticmethod |
| 232 | def _preprocess_caption(meta_l: List[Dict]): |
| 233 | new_meta = [] |
| 234 | for data_item in meta_l: |
| 235 | caption = data_item['caption'] |
| 236 | if isinstance(caption, list): |
| 237 | caption = random.choice(caption) |
| 238 | new_meta.append({ |
| 239 | "image": data_item['url'], |
| 240 | "output": caption |
| 241 | }) |
| 242 | |
| 243 | return new_meta |
| 244 | |
| 245 | |
| 246 | class FinetuneDistSampler(Sampler): |
nothing calls this directly
no outgoing calls
no test coverage detected