Skip to content

Commit

Permalink
fix distilbert
Browse files Browse the repository at this point in the history
  • Loading branch information
felixgwu committed Dec 22, 2019
1 parent fc56310 commit e18bd86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bert_score/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_model(model_type, num_layers, all_layers=None):
torch.nn.ModuleList([layer for layer in model.encoder.layer[:num_layers]])
elif hasattr(model, 'transformer'): # bert, roberta
model.transformer.layer =\
torch.nn.ModuleList([layer for layer in model.encoder.layer[:num_layers]])
torch.nn.ModuleList([layer for layer in model.transformer.layer[:num_layers]])
else:
raise ValueError("Not supported")
else:
Expand Down

0 comments on commit e18bd86

Please sign in to comment.