Skip to content

Commit 92217c7

Browse files
committed
📝 added README outlining steps to run the tests
1 parent a4a1a15 commit 92217c7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Running tests locally
2+
3+
1. Ensure that you have [tox](https://tox.wiki/en/4.24.1/) inside your Python environment, i.e. `pip install tox`.
4+
2. Run `tox` in the root directory of the repository.
5+
3. The tests will run and the results will be displayed in the terminal.
6+
7+
## A note on the dummy models
8+
9+
Some of the tests require some dummy models to be present in the `tests/dummy_models` directory. Dummy models were generated using [the create_dummy_models script](https://github.com/huggingface/transformers/blob/main/utils/create_dummy_models.py) and placed in the `tests/dummy_models` directory. If you want to regenerate a dummy model from scratch:
10+
11+
1. git clone the transformers repository: `git clone https://github.com/huggingface/transformers/tree/main`
12+
2. install transformers in the development mode: `pip install -e transformers`
13+
3. ensure to have the `torch` and `tensorflow` dependencies installed: `pip install torch tensorflow`
14+
4. ensure to have pytest installed: `pip install pytest`
15+
5. run the script: `python utils/create_dummy_models.py --model_types <INSERT VALID MODEL NAME> $MODEL_DIRECTORY`

0 commit comments

Comments
 (0)