jwieting commited on
Commit
a5eac20
1 Parent(s): 82026f0

Update modeling_paragram_sp.py

Browse files
Files changed (1) hide show
  1. modeling_paragram_sp.py +2 -0
modeling_paragram_sp.py CHANGED
@@ -29,6 +29,8 @@ class ParagramSPModel(BertPreTrainedModel):
29
  print(attention_mask)
30
  input_ids = self.filter_input_ids(input_ids)
31
  attention_mask = input_ids != self.config.pad_token_id
 
 
32
  embeddings = self.word_embeddings(input_ids)
33
  masked_embeddings = embeddings * attention_mask[:, :, None]
34
  mean_pooled_embeddings = masked_embeddings.sum(dim=1) / attention_mask[:, :, None].sum(dim=1)
 
29
  print(attention_mask)
30
  input_ids = self.filter_input_ids(input_ids)
31
  attention_mask = input_ids != self.config.pad_token_id
32
+ print(input_ids)
33
+ print(attention_mask)
34
  embeddings = self.word_embeddings(input_ids)
35
  masked_embeddings = embeddings * attention_mask[:, :, None]
36
  mean_pooled_embeddings = masked_embeddings.sum(dim=1) / attention_mask[:, :, None].sum(dim=1)