🚨🚨🚨 Use default ignore index in Luke (#23014)

Use default ignore index in Luke
This commit is contained in:
Sylvain Gugger 2023-04-26 17:55:01 -04:00 committed by GitHub
parent 8b129030cb
commit 0083b149e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1298,7 +1298,7 @@ class LukeForMaskedLM(LukePreTrainedModel):
self.lm_head = LukeLMHead(config)
self.entity_predictions = EntityPredictionHead(config)
self.loss_fn = nn.CrossEntropyLoss(ignore_index=-1)
self.loss_fn = nn.CrossEntropyLoss()
# Initialize weights and apply final processing
self.post_init()