Mehdi Cherti commited on
Commit
9935a02
1 Parent(s): df793a8
Files changed (1) hide show
  1. clip_encoder.py +2 -0
clip_encoder.py CHANGED
@@ -29,6 +29,8 @@ class CLIPEncoder(nn.Module):
29
  #self.output_size = self.model.transformer.width
30
 
31
  def forward(self, texts, return_only_pooled=False):
 
 
32
  device = next(self.parameters()).device
33
  toks = open_clip.tokenize(texts).to(device)
34
  x = self.model.token_embedding(toks) # [batch_size, n_ctx, d_model]
 
29
  #self.output_size = self.model.transformer.width
30
 
31
  def forward(self, texts, return_only_pooled=False):
32
+ return torch.randn(len(texts), self.output_size), torch.randn(len(texts), 77, self.output_size), torch.ones(len(texts), 77).bool()
33
+
34
  device = next(self.parameters()).device
35
  toks = open_clip.tokenize(texts).to(device)
36
  x = self.model.token_embedding(toks) # [batch_size, n_ctx, d_model]