Skip to content

Commit

Permalink
Windows support for LayoutXLM model (#1489)
Browse files Browse the repository at this point in the history
  • Loading branch information
yingyibiao authored Dec 20, 2021
1 parent d94b628 commit b089b21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paddlenlp/transformers/layoutxlm/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,8 @@ def forward(self, hidden_states, entities, relations):
for b in range(batch_size):
head_entities = paddle.to_tensor(relations[b]["head"])
tail_entities = paddle.to_tensor(relations[b]["tail"])
relation_labels = paddle.to_tensor(relations[b]["label"])
relation_labels = paddle.to_tensor(
relations[b]["label"], dtype='int64')
entities_start_index = paddle.to_tensor(entities[b]["start"])
entities_labels = paddle.to_tensor(entities[b]["label"])
head_index = entities_start_index[head_entities]
Expand Down

0 comments on commit b089b21

Please sign in to comment.