(self, image)
| 362 | |
| 363 | |
| 364 | def encode_image(self, image): |
| 365 | with torch.cuda.amp.autocast(enabled=False): |
| 366 | image = image.half() |
| 367 | image_tokens = self.clip_encode_image(image) |
| 368 | image = image.to(self.clip_proj.weight.dtype) |
| 369 | image_tokens = self.clip_proj_norm(self.clip_proj(image_tokens)) |
| 370 | return image_tokens |
| 371 | |
| 372 | |
| 373 | def forward(self, examples, image=None): |
no test coverage detected