chanfee commited on
Commit
c806e96
·
verified ·
1 Parent(s): 0086dc0

Update utils/model.py

Browse files
Files changed (1) hide show
  1. utils/model.py +2 -2
utils/model.py CHANGED
@@ -419,10 +419,10 @@ class OwlViTForClassification(nn.Module):
419
  else:
420
  #DEUBUG:
421
  print(f"text_inputs_parts - input_ids: {text_inputs_parts['input_ids'].shape}. attention_mask : {text_inputs_parts['attention_mask'].shape}")
422
- seq_length = input_ids.shape[-1]
423
  position_ids = self.owlvit.text_model.embeddings.position_ids[:, :seq_length]
424
  print(f"position_embedding: {self.owlvit.text_model.embeddings.position_embedding(position_ids).shape}")
425
- print(f"text_embeds: {self.owlvit.text_model.text_model.token_embedding(input_ids).shape}")
426
  text_embeds_parts = self.owlvit.text_model.text_model.get_text_features(**text_inputs_parts)
427
 
428
  # # Embed images and text queries
 
419
  else:
420
  #DEUBUG:
421
  print(f"text_inputs_parts - input_ids: {text_inputs_parts['input_ids'].shape}. attention_mask : {text_inputs_parts['attention_mask'].shape}")
422
+ seq_length = text_inputs_parts['input_ids'].shape[-1]
423
  position_ids = self.owlvit.text_model.embeddings.position_ids[:, :seq_length]
424
  print(f"position_embedding: {self.owlvit.text_model.embeddings.position_embedding(position_ids).shape}")
425
+ print(f"text_embeds: {self.owlvit.text_model.embeddings.token_embedding(text_inputs_parts['input_ids']).shape}")
426
  text_embeds_parts = self.owlvit.text_model.text_model.get_text_features(**text_inputs_parts)
427
 
428
  # # Embed images and text queries