jwieting commited on
Commit
bcab452
1 Parent(s): 5268492

Update modeling_paragram_sp.py

Browse files
Files changed (1) hide show
  1. modeling_paragram_sp.py +5 -4
modeling_paragram_sp.py CHANGED
@@ -13,11 +13,12 @@ class ParagramSPModel(BertPreTrainedModel):
13
  def filter_input_ids(self, input_ids):
14
  output = []
15
  len = input_ids.shape[1]
16
- for ids in input_ids.shape[0]:
 
17
  filtered_ids = []
18
- for i in ids:
19
- if i > 0:
20
- filtered_ids.append(i)
21
  if len(filtered_ids) == 0:
22
  filtered_ids = [0]
23
  output.append(filtered_ids + [config.pad_token_id] * (len - len(filtered_ids)))
 
13
  def filter_input_ids(self, input_ids):
14
  output = []
15
  len = input_ids.shape[1]
16
+ for i in range(input_ids.shape[0]):
17
+ ids = input_ids[i]
18
  filtered_ids = []
19
+ for j in ids:
20
+ if j > 0:
21
+ filtered_ids.append(j)
22
  if len(filtered_ids) == 0:
23
  filtered_ids = [0]
24
  output.append(filtered_ids + [config.pad_token_id] * (len - len(filtered_ids)))