(self, image)
| 595 | |
| 596 | |
| 597 | def encode_image(self, image): |
| 598 | with torch.cuda.amp.autocast(enabled=False): |
| 599 | image = image.half() |
| 600 | image_tokens = self.clip_encode_image(image) |
| 601 | image = image.to(self.clip_proj.weight.dtype) |
| 602 | image_tokens = self.clip_proj_norm(self.clip_proj(image_tokens)) |
| 603 | return image_tokens |
| 604 | |
| 605 | |
| 606 | def forward(self, examples, image=None): |
no test coverage detected