fix hasattr

This commit is contained in:
thomwolf 2019-02-08 23:08:53 +01:00
parent 0c1a6f9b1d
commit cfcb95417c

View File

@ -970,7 +970,7 @@ class TransfoXLPreTrainedModel(nn.Module):
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
model.__class__.__name__, "\n\t".join(error_msgs)))
# Make sure we are still sharing the input and output embeddings
if model.hasattr('tie_weights'):
if hasattr(model, 'tie_weights'):
model.tie_weights()
return model