Skip to content

Commit

Permalink
readme adjustments and utils.py formated+ setting.json onto gitignore…
Browse files Browse the repository at this point in the history
… to not push personal adjustments
  • Loading branch information
tom2208 committed Feb 7, 2025
1 parent ed1e253 commit 700129b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,5 @@ logs/
saved_models/*

lightning_logs/

settings.json
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,20 @@ If you wish to test only the models or datasets, use the following commands:
To test the models: `pytest tests/test_models.py`
To test the datasets: `pytest tests/test_datasets.py`

You may add the flags `--html=report.html` or `--junitxml=report.xml` for generating test reports. Another way is using the integrated testing functionallity in VS Code: Just click at the Erlenmeyer flask / test tube icon at the side bar.
You can generate test reports by adding the flags --html=report.html or --junitxml=report.xml when running pytest.

Alternatively, you can use VS Code’s integrated testing functionality. Simply click the test tube (🧪) icon in the sidebar to access and run your tests interactively.

To specify which GPUs the tests should run on, uncomment the following line in tests/utils.py:
```python
base_command = [
"python",
"birdset/train.py",
"trainer.fast_dev_run=True",
# "trainer.devices=[1]",
]
```
This enables the Hydra override, directing the tests to use GPU 1 in this case.

## Q&A

Expand Down
7 changes: 6 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ def generate_commands(experiments):
Returns:
dict: A dictionary where keys are experiment paths and values are commands.
"""
base_command = ["python", "birdset/train.py", "trainer.fast_dev_run=True"]
base_command = [
"python",
"birdset/train.py",
"trainer.fast_dev_run=True",
# "trainer.devices=[1]",
]
return {
exp: base_command[:2] + [f"experiment={exp}"] + base_command[2:]
for exp in experiments
Expand Down

0 comments on commit 700129b

Please sign in to comment.