From e2dc558e9c8eae3409481ca74efc15e07f8e90c8 Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Wed, 12 Oct 2022 09:44:07 +0200 Subject: [PATCH] [Doctest] Add `configuration_bert.py` to doctest (#19485) * BertConfig for doctest * Change import order Co-authored-by: ydshieh --- src/transformers/models/bert/configuration_bert.py | 4 ++-- utils/documentation_tests.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/transformers/models/bert/configuration_bert.py b/src/transformers/models/bert/configuration_bert.py index 25c0f5b67ef..b3dfcdff75e 100644 --- a/src/transformers/models/bert/configuration_bert.py +++ b/src/transformers/models/bert/configuration_bert.py @@ -123,12 +123,12 @@ class BertConfig(PretrainedConfig): Examples: ```python - >>> from transformers import BertModel, BertConfig + >>> from transformers import BertConfig, BertModel >>> # Initializing a BERT bert-base-uncased style configuration >>> configuration = BertConfig() - >>> # Initializing a model from the bert-base-uncased style configuration + >>> # Initializing a model (with random weights) from the bert-base-uncased style configuration >>> model = BertModel(configuration) >>> # Accessing the model configuration diff --git a/utils/documentation_tests.txt b/utils/documentation_tests.txt index a39dc7a56a8..769b7ca0982 100644 --- a/utils/documentation_tests.txt +++ b/utils/documentation_tests.txt @@ -16,6 +16,7 @@ src/transformers/models/albert/modeling_albert.py src/transformers/models/albert/modeling_tf_albert.py src/transformers/models/bart/modeling_bart.py src/transformers/models/beit/modeling_beit.py +src/transformers/models/bert/configuration_bert.py src/transformers/models/bert/modeling_bert.py src/transformers/models/bert/modeling_tf_bert.py src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py