Skip to content

Commit

Permalink
Modify typo (#297)
Browse files Browse the repository at this point in the history
Co-authored-by: zhezhaoa <1152543959@qq.com>
  • Loading branch information
lots-o and zhezhaoa committed Oct 12, 2023
1 parent 7079fa5 commit 05432c0
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions scripts/convert_bert_from_uer_to_huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,6 @@ def main():

convert_bert_transformer_encoder_from_uer_to_huggingface(input_model, output_model, args.layers_num)

if args.type == "bert":
output_model["bert.pooler.dense.weight"] = input_model["target.sp.linear_1.weight"]
output_model["bert.pooler.dense.bias"] = input_model["target.sp.linear_1.bias"]
output_model["cls.seq_relationship.weight"] = input_model["target.sp.linear_2.weight"]
output_model["cls.seq_relationship.bias"] = input_model["target.sp.linear_2.bias"]
output_model["cls.predictions.transform.dense.weight"] = input_model["target.mlm.linear_1.weight"]
output_model["cls.predictions.transform.dense.bias"] = input_model["target.mlm.linear_1.bias"]
output_model["cls.predictions.transform.LayerNorm.weight"] = input_model["target.layer_norm.gamma"]
output_model["cls.predictions.transform.LayerNorm.bias"] = input_model["target.layer_norm.beta"]
output_model["cls.predictions.decoder.weight"] = input_model["target.mlm.linear_2.weight"]
output_model["cls.predictions.bias"] = input_model["target.mlm.linear_2.bias"]

torch.save(output_model, args.output_model_path)


Expand Down

0 comments on commit 05432c0

Please sign in to comment.