Skip to content

Commit 0844168

Browse files
authored
fix semantic search modeling (#3094)
1 parent 4ec0b62 commit 0844168

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

paddlenlp/transformers/semantic_search/modeling.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,18 @@ def forward(self,
170170
query_attention_mask)
171171

172172
pos_title_cls_embedding = self.get_pooled_embedding(
173-
pos_title_input_ids, pos_title_token_type_ids,
174-
pos_title_position_ids, pos_title_attention_mask)
173+
pos_title_input_ids,
174+
pos_title_token_type_ids,
175+
pos_title_position_ids,
176+
pos_title_attention_mask,
177+
is_query=False)
175178

176179
neg_title_cls_embedding = self.get_pooled_embedding(
177-
neg_title_input_ids, neg_title_token_type_ids,
178-
neg_title_position_ids, neg_title_attention_mask)
180+
neg_title_input_ids,
181+
neg_title_token_type_ids,
182+
neg_title_position_ids,
183+
neg_title_attention_mask,
184+
is_query=False)
179185

180186
all_title_cls_embedding = paddle.concat(
181187
x=[pos_title_cls_embedding, neg_title_cls_embedding], axis=0)

0 commit comments

Comments
 (0)