From 4cc1bf81ee1326f1779f99ed5cc85370a550ef4a Mon Sep 17 00:00:00 2001 From: thomwolf Date: Sat, 27 Jul 2019 12:08:21 +0200 Subject: [PATCH] typos --- pytorch_transformers/modeling_auto.py | 4 ++-- pytorch_transformers/modeling_utils.py | 4 ++-- pytorch_transformers/tokenization_bert.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pytorch_transformers/modeling_auto.py b/pytorch_transformers/modeling_auto.py index 68eb85cbd8..aa50b1526d 100644 --- a/pytorch_transformers/modeling_auto.py +++ b/pytorch_transformers/modeling_auto.py @@ -157,7 +157,7 @@ class AutoModel(object): - contains `xlnet`: XLNetConfig (XLNet model) - contains `xlm`: XLMConfig (XLM model) - The model is set in evaluation mode by default using `model.eval()` (Dropout modules are desactivated) + The model is set in evaluation mode by default using `model.eval()` (Dropout modules are deactivated) To train the model, you should first set it back in training mode with `model.train()` Params: @@ -179,7 +179,7 @@ class AutoModel(object): - the model was saved using the `save_pretrained(save_directory)` (loaded by suppling the save directory). **state_dict**: an optional state dictionnary for the model to use instead of a state dictionary loaded from saved weights file. - This option can be used if you want to create a model from a pretrained configuraton but load your own weights. + This option can be used if you want to create a model from a pretrained configuration but load your own weights. In this case though, you should check if using `save_pretrained(dir)` and `from_pretrained(save_directory)` is not a simpler option. **cache_dir**: (`optional`) string: diff --git a/pytorch_transformers/modeling_utils.py b/pytorch_transformers/modeling_utils.py index 4fabd49baf..7ae834f5e5 100644 --- a/pytorch_transformers/modeling_utils.py +++ b/pytorch_transformers/modeling_utils.py @@ -324,7 +324,7 @@ class PreTrainedModel(nn.Module): def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs): r"""Instantiate a pretrained pytorch model from a pre-trained model configuration. - The model is set in evaluation mode by default using `model.eval()` (Dropout modules are desactivated) + The model is set in evaluation mode by default using `model.eval()` (Dropout modules are deactivated) To train the model, you should first set it back in training mode with `model.train()` Params: @@ -346,7 +346,7 @@ class PreTrainedModel(nn.Module): - the model was saved using the `save_pretrained(save_directory)` (loaded by suppling the save directory). **state_dict**: an optional state dictionnary for the model to use instead of a state dictionary loaded from saved weights file. - This option can be used if you want to create a model from a pretrained configuraton but load your own weights. + This option can be used if you want to create a model from a pretrained configuration but load your own weights. In this case though, you should check if using `save_pretrained(dir)` and `from_pretrained(save_directory)` is not a simpler option. **cache_dir**: (`optional`) string: diff --git a/pytorch_transformers/tokenization_bert.py b/pytorch_transformers/tokenization_bert.py index f9c97b7d12..d9cd881dfd 100644 --- a/pytorch_transformers/tokenization_bert.py +++ b/pytorch_transformers/tokenization_bert.py @@ -119,7 +119,7 @@ class BertTokenizer(PreTrainedTokenizer): Only has an effect when do_basic_tokenize=True **tokenize_chinese_chars**: (`optional`) boolean (default True) Whether to tokenize Chinese characters. - This should likely be desactivated for Japanese: + This should likely be deactivated for Japanese: see: https://github.com/huggingface/pytorch-pretrained-BERT/issues/328 """ super(BertTokenizer, self).__init__(unk_token=unk_token, sep_token=sep_token, @@ -214,7 +214,7 @@ class BasicTokenizer(object): List of token not to split. **tokenize_chinese_chars**: (`optional`) boolean (default True) Whether to tokenize Chinese characters. - This should likely be desactivated for Japanese: + This should likely be deactivated for Japanese: see: https://github.com/huggingface/pytorch-pretrained-BERT/issues/328 """ if never_split is None: