transformers/templates/adding_a_new_example_script
Arthur 651408a077
[Styling] stylify using ruff (#27144)
* try to stylify using ruff

* might need to remove these changes?

* use ruf format andruff check

* use isinstance instead of type comparision

* use # fmt: skip

* use # fmt: skip

* nits

* soem styling changes

* update ci job

* nits isinstance

* more files update

* nits

* more nits

* small nits

* check and format

* revert wrong changes

* actually use formatter instead of checker

* nits

* well docbuilder is overwriting this commit

* revert notebook changes

* try to nuke docbuilder

* style

* fix feature exrtaction test

* remve `indent-width = 4`

* fixup

* more nits

* update the ruff version that we use

* style

* nuke docbuilder styling

* leve the print for detected changes

* nits

* Remove file I/O

Co-authored-by: charliermarsh
 <charlie.r.marsh@gmail.com>

* style

* nits

* revert notebook changes

* Add # fmt skip when possible

* Add # fmt skip when possible

* Fix

* More `  # fmt: skip` usage

* More `  # fmt: skip` usage

* More `  # fmt: skip` usage

* NIts

* more fixes

* fix tapas

* Another way to skip

* Recommended way

* Fix two more fiels

* Remove asynch
Remove asynch

---------

Co-authored-by: charliermarsh <charlie.r.marsh@gmail.com>
2023-11-16 17:43:19 +01:00
..
{{cookiecutter.directory_name}} [Styling] stylify using ruff (#27144) 2023-11-16 17:43:19 +01:00
cookiecutter.json Update the example template for a no Trainer option (#10865) 2021-03-23 10:02:39 -04:00
README.md Copyright (#8970) 2020-12-07 18:36:34 -05:00

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. To use it, you will need to install cookiecutter:

pip install cookiecutter

or refer to the installation page of the cookiecutter documentation.

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.

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.

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!