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

This folder provide a template for adding a new example script implementing a training or inference task with the models in the  馃Transformers library.
4
Add tests!
thomwolf's avatar
thomwolf committed
5

6
7
8
9
10
11
12
13
14
15

These folder can be put in a subdirectory under your example's name, like `examples/deebert`.


Best Practices: 
- use `Trainer`/`TFTrainer`
- write an @slow test that checks that your model can train on one batch and get a low loss.
    - this test should use cuda if it's available. (e.g. by checking `transformers.torch_device`)
- adding an `eval_xxx.py` script that can evaluate a pretrained checkpoint.  
- tweet about your new example with a carbon screenshot of how to run it and tag @huggingface