Skip to content

[Doctest] Add configuration_bert.py#19485

Merged
ydshieh merged 2 commits intohuggingface:mainfrom
ydshieh:bert_config_doctest
Oct 12, 2022
Merged

[Doctest] Add configuration_bert.py#19485
ydshieh merged 2 commits intohuggingface:mainfrom
ydshieh:bert_config_doctest

Conversation

@ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Oct 11, 2022

What does this PR do?

Add configuration_bert.py to utils/documentation_tests.txt for doctest.

This PR will be used as a template for a new sprint.


```python
>>> from transformers import BertModel, BertConfig
>>> from transformers import BertConfig, BertModel
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the import order of the model and configuration classes

>>> 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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add (with random weights) in the comment before model initialization

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 11, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying the example!

@imarekkus imarekkus mentioned this pull request Oct 11, 2022
Copy link
Contributor

@NielsRogge NielsRogge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better :) thanks!

@ydshieh ydshieh merged commit e2dc558 into huggingface:main Oct 12, 2022
@ydshieh ydshieh deleted the bert_config_doctest branch October 12, 2022 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants