transformers/templates/adding_a_new_example_script
Teven 5a0dac53bf
Empty assert hunt (#6056)
* Fixed empty asserts

* black-reformatted stragglers in templates

* More code quality checks

* Update src/transformers/convert_marian_to_pytorch.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update src/transformers/convert_marian_to_pytorch.py

Co-authored-by: Sam Shleifer <sshleifer@gmail.com>

* removed unused line as per @sshleifer

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Sam Shleifer <sshleifer@gmail.com>
2020-08-03 10:19:03 +02:00
..
README.md [docs] Add integration test example to copy pasta template (#5961) 2020-07-22 12:48:38 -04:00
run_xxx.py save_pretrained: mkdir(exist_ok=True) (#5258) 2020-06-28 14:53:47 -04:00
utils_xxx.py Empty assert hunt (#6056) 2020-08-03 10:19:03 +02:00

README.md

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. Add tests!

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