Commit cfcb9541 authored by thomwolf's avatar thomwolf
Browse files

fix hasattr

parent 0c1a6f9b
...@@ -970,7 +970,7 @@ class TransfoXLPreTrainedModel(nn.Module): ...@@ -970,7 +970,7 @@ class TransfoXLPreTrainedModel(nn.Module):
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
model.__class__.__name__, "\n\t".join(error_msgs))) model.__class__.__name__, "\n\t".join(error_msgs)))
# Make sure we are still sharing the input and output embeddings # Make sure we are still sharing the input and output embeddings
if model.hasattr('tie_weights'): if hasattr(model, 'tie_weights'):
model.tie_weights() model.tie_weights()
return model return model
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment