From 3242e4d94292944d490b26fc376cf6a6978c20b9 Mon Sep 17 00:00:00 2001 From: Julien Chaumond Date: Wed, 26 Aug 2020 23:16:06 +0200 Subject: [PATCH] [model_cards] Fix tiny typos --- README.md | 2 +- model_cards/joeddav/xlm-roberta-large-xnli/README.md | 4 ++-- src/transformers/modeling_marian.py | 2 +- tests/test_modeling_tf_common.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f43360e3db..9d82251138 100644 --- a/README.md +++ b/README.md @@ -625,7 +625,7 @@ Breaking change in the `from_pretrained()` method: 1. Models are now set in evaluation mode by default when instantiated with the `from_pretrained()` method. To train them, don't forget to set them back in training mode (`model.train()`) to activate the dropout modules. -2. The additional `*input` and `**kwargs` arguments supplied to the `from_pretrained()` method used to be directly passed to the underlying model's class `__init__()` method. They are now used to update the model configuration attribute instead, which can break derived model classes built based on the previous `BertForSequenceClassification` examples. We are working on a way to mitigate this breaking change in [#866](https://github.com/huggingface/transformers/pull/866) by forwarding the the model's `__init__()` method (i) the provided positional arguments and (ii) the keyword arguments which do not match any configuration class attributes. +2. The additional `*input` and `**kwargs` arguments supplied to the `from_pretrained()` method used to be directly passed to the underlying model's class `__init__()` method. They are now used to update the model configuration attribute instead, which can break derived model classes built based on the previous `BertForSequenceClassification` examples. We are working on a way to mitigate this breaking change in [#866](https://github.com/huggingface/transformers/pull/866) by forwarding the model's `__init__()` method (i) the provided positional arguments and (ii) the keyword arguments which do not match any configuration class attributes. Also, while not a breaking change, the serialization methods have been standardized and you probably should switch to the new method `save_pretrained(save_directory)` if you were using any other serialization method before. diff --git a/model_cards/joeddav/xlm-roberta-large-xnli/README.md b/model_cards/joeddav/xlm-roberta-large-xnli/README.md index 1104e9574f..50dc3ab487 100644 --- a/model_cards/joeddav/xlm-roberta-large-xnli/README.md +++ b/model_cards/joeddav/xlm-roberta-large-xnli/README.md @@ -57,7 +57,7 @@ classifier = pipeline("zero-shot-classification", model="joeddav/xlm-roberta-large-xnli") ``` -You can then classify in any of the above langauges. You can even pass the labels in one language and the sequence to +You can then classify in any of the above languages. You can even pass the labels in one language and the sequence to classify in another: ```python @@ -112,6 +112,6 @@ prob_label_is_true = probs[:,1] This model was pre-trained on set of 100 languages, as described in [the original paper](https://arxiv.org/abs/1911.02116). It was then fine-tuned on the task of NLI on the concatenated MNLI train set and the XNLI validation and test sets. Finally, it was trained for one additional epoch on only XNLI -data where the the translations for the premise and hypothesis are shuffled such that the premise and hypothesis for +data where the translations for the premise and hypothesis are shuffled such that the premise and hypothesis for each example come from the same original English example but the premise and hypothesis are of different languages. diff --git a/src/transformers/modeling_marian.py b/src/transformers/modeling_marian.py index 97fe451a38..977cf55e7f 100644 --- a/src/transformers/modeling_marian.py +++ b/src/transformers/modeling_marian.py @@ -42,7 +42,7 @@ class MarianMTModel(BartForConditionalGeneration): >>> tok = MarianTokenizer.from_pretrained(mname) >>> batch = tok.prepare_seq2seq_batch(src_texts=[sample_text]) # don't need tgt_text for inference >>> gen = model.generate(**batch) # for forward pass: model(**batch) - >>> words: List[str] = tok.batch_decode(gen, skip_special_tokens=True) # returns "Where is the the bus stop ?" + >>> words: List[str] = tok.batch_decode(gen, skip_special_tokens=True) # returns "Where is the bus stop ?" """ diff --git a/tests/test_modeling_tf_common.py b/tests/test_modeling_tf_common.py index 298105ffe9..32c79abba9 100644 --- a/tests/test_modeling_tf_common.py +++ b/tests/test_modeling_tf_common.py @@ -646,7 +646,7 @@ class TFModelTesterMixin: emb_old.build(INPUT_SHAPE) # reshape the embeddings new_embeddings = model._get_resized_embeddings(emb_old, size) - # # check that the the resized embeddings size matches the desired size. + # # check that the resized embeddings size matches the desired size. assert_size = size if size is not None else config.vocab_size self.assertEqual(new_embeddings.shape[0], assert_size) # check that weights remain the same after resizing