mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Adding example detailing how to add a new file to the documentation + adding fonts.
This commit is contained in:
parent
6847e30e1c
commit
269e73b601
@ -1,6 +1,18 @@
|
||||
# Generating the documentation
|
||||
|
||||
To generate the documentation, you first have to build it. Building it requires the package `sphinx` that you can
|
||||
To generate the documentation, you first have to build it. Several packages are necessary to build the doc,
|
||||
you can install them using:
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Packages installed
|
||||
|
||||
Here's an overview of all the packages installed. If you ran the previous command installing all packages from
|
||||
`requirements.txt`, you do not need to run the following commands.
|
||||
|
||||
Building it requires the package `sphinx` that you can
|
||||
install using:
|
||||
|
||||
```bash
|
||||
@ -14,10 +26,35 @@ You would also need the custom installed [theme](https://github.com/readthedocs/
|
||||
pip install sphinx_rtd_theme
|
||||
```
|
||||
|
||||
The third necessary package is the `recommonmark` package to accept Markdown as well as Restructured text:
|
||||
|
||||
```bash
|
||||
pip install recommonmark
|
||||
```
|
||||
|
||||
## Building the documentation
|
||||
|
||||
Once you have setup `sphinx`, you can build the documentation by running the following command in the `/docs` folder:
|
||||
|
||||
```bash
|
||||
make html
|
||||
```
|
||||
|
||||
It should build the static app that will be available under `/docs/_build/html`
|
||||
---
|
||||
**NOTE**
|
||||
|
||||
If you are adding/removing elements from the toc-tree or from any strutural item, it is recommended to clean the build
|
||||
directory before rebuilding. Run the following command to clean and build:
|
||||
|
||||
```bash
|
||||
make clean && make html
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
It should build the static app that will be available under `/docs/_build/html`
|
||||
|
||||
## Adding a new element to the tree (toc-tree)
|
||||
|
||||
Acceptes files are reStructuredText (.rst) and Markdown (.md). Create a file with its extension and put it
|
||||
in the source directory. You can then link it to the toc-tree by putting the filename without the extension.
|
BIN
docs/source/_static/css/Calibre-Light.ttf
Normal file
BIN
docs/source/_static/css/Calibre-Light.ttf
Normal file
Binary file not shown.
BIN
docs/source/_static/css/Calibre-Medium.otf
Normal file
BIN
docs/source/_static/css/Calibre-Medium.otf
Normal file
Binary file not shown.
BIN
docs/source/_static/css/Calibre-Regular.otf
Normal file
BIN
docs/source/_static/css/Calibre-Regular.otf
Normal file
Binary file not shown.
BIN
docs/source/_static/css/Calibre-Thin.otf
Normal file
BIN
docs/source/_static/css/Calibre-Thin.otf
Normal file
Binary file not shown.
1
docs/source/bertology.md
Normal file
1
docs/source/bertology.md
Normal file
@ -0,0 +1 @@
|
||||
# Bertology
|
@ -41,7 +41,8 @@ release = u'1.0.0'
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.napoleon'
|
||||
'sphinx.ext.napoleon',
|
||||
'recommonmark'
|
||||
|
||||
]
|
||||
|
||||
|
@ -7,11 +7,14 @@ Pytorch-Transformers
|
||||
:caption: Notes
|
||||
|
||||
installation
|
||||
philosophy
|
||||
usage
|
||||
examples
|
||||
notebooks
|
||||
tpu
|
||||
cli
|
||||
migration
|
||||
bertology
|
||||
torchscript
|
||||
|
||||
|
||||
|
1
docs/source/migration.md
Normal file
1
docs/source/migration.md
Normal file
@ -0,0 +1 @@
|
||||
# Migration
|
1
docs/source/philosophy.md
Normal file
1
docs/source/philosophy.md
Normal file
@ -0,0 +1 @@
|
||||
# Philosophy
|
@ -122,9 +122,4 @@ Using the traced model for inference is as simple as using its ``__call__`` dund
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
traced_model(tokens_tensor, segments_tensors)
|
||||
|
||||
(Optional) Using TorchScript in C++
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Below are examples of using a model exported using Python in C++.
|
||||
traced_model(tokens_tensor, segments_tensors)
|
Loading…
Reference in New Issue
Block a user