README.md 1.12 KB
Newer Older
1
# How to add a new example script in 馃 Transformers
thomwolf's avatar
thomwolf committed
2

3
4
5
6
7
8
This folder provide a template for adding a new example script implementing a training or inference task with the
models in the 馃 Transformers library. To use it, you will need to install cookiecutter:
```
pip install cookiecutter
```
or refer to the installation page of the [cookiecutter documentation](https://cookiecutter.readthedocs.io/).
thomwolf's avatar
thomwolf committed
9

10
11
12
13
14
15
You can then run the following command inside the `examples` folder of the transformers repo:
```
cookiecutter ../templates/adding_a_new_example_script/
```
and answer the questions asked, which will generate a new folder where you will find a pre-filled template for your
example following the best practices we recommend for them.
16

17
18
19
Adjust the way the data is preprocessed, the model is loaded or the Trainer is instantiated then when you're happy, add
a `README.md` in the folder (or complete the existing one if you added a script to an existing folder) telling a user
how to run your script.
20

21
22
Make a PR to the 馃 Transformers repo. Don't forget to tweet about your new example with a carbon screenshot of how to
run it and tag @huggingface!