From 94eb68d74202f4c8ed90a0f7a74a9dffa1487a0a Mon Sep 17 00:00:00 2001 From: Julien Chaumond Date: Sat, 4 Apr 2020 15:03:26 -0400 Subject: [PATCH] weigths*weights --- docs/source/migration.md | 2 +- src/transformers/modeling_transfo_xl.py | 2 +- src/transformers/modeling_xlnet.py | 2 +- templates/adding_a_new_model/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/migration.md b/docs/source/migration.md index f50d1dff0a..d838bf5c43 100644 --- a/docs/source/migration.md +++ b/docs/source/migration.md @@ -27,7 +27,7 @@ loss = outputs[0] # In transformers you can also have access to the logits: loss, logits = outputs[:2] -# And even the attention weigths if you configure the model to output them (and other outputs too, see the docstrings and documentation) +# And even the attention weights if you configure the model to output them (and other outputs too, see the docstrings and documentation) model = BertForSequenceClassification.from_pretrained('bert-base-uncased', output_attentions=True) outputs = model(input_ids, labels=labels) loss, logits, attentions = outputs diff --git a/src/transformers/modeling_transfo_xl.py b/src/transformers/modeling_transfo_xl.py index dd626c2cf9..c3bd4076b1 100644 --- a/src/transformers/modeling_transfo_xl.py +++ b/src/transformers/modeling_transfo_xl.py @@ -136,7 +136,7 @@ def load_tf_weights_in_transfo_xl(model, config, tf_path): if "kernel" in name or "proj" in name: array = np.transpose(array) if ("r_r_bias" in name or "r_w_bias" in name) and len(pointer) > 1: - # Here we will split the TF weigths + # Here we will split the TF weights assert len(pointer) == array.shape[0] for i, p_i in enumerate(pointer): arr_i = array[i, ...] diff --git a/src/transformers/modeling_xlnet.py b/src/transformers/modeling_xlnet.py index 7d34e7ef2b..aad18ccb1c 100644 --- a/src/transformers/modeling_xlnet.py +++ b/src/transformers/modeling_xlnet.py @@ -156,7 +156,7 @@ def load_tf_weights_in_xlnet(model, config, tf_path): logger.info("Transposing") array = np.transpose(array) if isinstance(pointer, list): - # Here we will split the TF weigths + # Here we will split the TF weights assert len(pointer) == array.shape[0] for i, p_i in enumerate(pointer): arr_i = array[i, ...] diff --git a/templates/adding_a_new_model/README.md b/templates/adding_a_new_model/README.md index 5397ca4c78..81af5cfba5 100644 --- a/templates/adding_a_new_model/README.md +++ b/templates/adding_a_new_model/README.md @@ -59,4 +59,4 @@ You can then finish the addition step by adding imports for your classes in the - [ ] add a link to your conversion script in the main conversion utility (in `commands/convert.py`) - [ ] edit the PyTorch to TF 2.0 conversion script to add your model in the `convert_pytorch_checkpoint_to_tf2.py` file - [ ] add a mention of your model in the doc: `README.md` and the documentation itself at `docs/source/pretrained_models.rst`. -- [ ] upload the pretrained weigths, configurations and vocabulary files. +- [ ] upload the pretrained weights, configurations and vocabulary files.