(input_size)
| 39 | return False |
| 40 | |
| 41 | def build_transform(input_size): |
| 42 | transform = T.Compose([ |
| 43 | T.Lambda(lambda img: img.convert('RGB') if img.mode != 'RGB' else img), |
| 44 | T.Resize((input_size, input_size), interpolation=InterpolationMode.BICUBIC), |
| 45 | T.ToTensor(), |
| 46 | T.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)) |
| 47 | ]) |
| 48 | return transform |
| 49 | |
| 50 | def format_inputs(sources): |
| 51 | # Apply prompt templates |