From 3566d2791905269b75014e8ea9db322c86f980b2 Mon Sep 17 00:00:00 2001 From: LysandreJik Date: Thu, 8 Aug 2019 19:04:34 -0400 Subject: [PATCH] Clarified PreTrainedModel.from_pretrained warning messages in documentation. --- pytorch_transformers/modeling_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pytorch_transformers/modeling_utils.py b/pytorch_transformers/modeling_utils.py index 5a753392fa..35f82e324f 100644 --- a/pytorch_transformers/modeling_utils.py +++ b/pytorch_transformers/modeling_utils.py @@ -365,6 +365,11 @@ class PreTrainedModel(nn.Module): 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()`` + The warning ``Weights from XXX not initialized from pretrained model`` means that the weights of XXX do not come pre-trained with the rest of the model. + It is up to you to train those weights with a downstream fine-tuning task. + + The warning ``Weights from XXX not used in YYY`` means that the layer XXX is not used by YYY, therefore those weights are discarded. + Parameters: pretrained_model_name_or_path: either: