Skip to content

Commit

Permalink
fix unified transformer dtype problem (PaddlePaddle#747)
Browse files Browse the repository at this point in the history
* fix unified transformer dtype problem

* fix win dtype bug
  • Loading branch information
smallv0221 committed Jul 14, 2021
1 parent f61a294 commit 3dd0bd4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/dialogue/unified_transformer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ def pad_mask(batch_attention_mask):
(max_len - example['seq_len']) + i * max_len
for i, example in enumerate(batch_examples)
])
labels = np.concatenate(
[np.array(example['labels']) for example in batch_examples])
labels = np.concatenate([
np.array(
example['labels'], dtype='int64') for example in batch_examples
])
return input_ids, token_type_ids, position_ids, attention_mask, masked_positions, labels
else:
return input_ids, token_type_ids, position_ids, attention_mask
Expand Down

0 comments on commit 3dd0bd4

Please sign in to comment.