(self, clip_embed, clip_embed_zeroed)
| 85 | |
| 86 | @torch.inference_mode() |
| 87 | def get_image_embeds(self, clip_embed, clip_embed_zeroed): |
| 88 | #image_prompt_embeds = clip_embed.clone().detach() |
| 89 | image_prompt_embeds = self.image_proj_model(clip_embed) |
| 90 | #uncond_image_prompt_embeds = clip_embed_zeroed.clone().detach() |
| 91 | uncond_image_prompt_embeds = self.image_proj_model(clip_embed_zeroed) |
| 92 | |
| 93 | return image_prompt_embeds, uncond_image_prompt_embeds |
| 94 | |
| 95 | class ImageProjModel(torch.nn.Module): |
| 96 | def __init__(self, cross_attention_dim=1024, clip_embeddings_dim=1024, clip_extra_context_tokens=4): |
no outgoing calls
no test coverage detected