Add a template for examples and apply it for mlm and plm examples (#8153)

* Add a template for example scripts and apply it to mlm

* Formatting

* Fix test

* Add plm script

* Add a template for example scripts and apply it to mlm

* Formatting

* Fix test

* Add plm script

* Add a template for example scripts and apply it to mlm

* Formatting

* Fix test

* Add plm script

* Styling
This commit is contained in:
Sylvain Gugger
2020-10-29 13:38:11 -04:00
committed by GitHub
parent 49e4fece5c
commit 691176283d
12 changed files with 1000 additions and 1741 deletions

View File

@@ -520,7 +520,7 @@ class DataCollatorForPermutationLanguageModeling:
perm_index.reshape((labels.size(1), 1)) <= perm_index.reshape((1, labels.size(1)))
) & masked_indices[i]
return inputs, perm_mask, target_mapping, labels
return inputs.long(), perm_mask, target_mapping, labels.long()
@dataclass