We want to make contributing to this project as easy and transparent as possible.
In order to accept your pull request, we need you to submit a CLA. You only need to do this once to work on any of Meta's open source projects.
Complete your CLA here: https://code.facebook.com/cla
We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue.
Meta has a bounty program for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue.
Same as in README with the exception of:
pip install -e ".[dev]"
... (in particular how this is synced with internal changes to the project)
We actively welcome your pull requests.
- Fork the repo and create your branch from
main
. - If you've added code that should be tested, add tests.
- If you've changed APIs, update the documentation.
- Ensure the test suite passes.
- Make sure your code lints.
- If you haven't already, complete the Contributor License Agreement ("CLA").
TorchMultimodal uses pre-commit hooks to ensure style consistency and prevent common mistakes. Enable it by:
pre-commit install
After this pre-commit hooks will be run before every commit.
Ideally, flake and ufmt should be run via pre-commit hooks. But if for some reason you want to run them separately follow this:
pip install -r dev-requirements.txt
flake8 (examples|test|torchmultimodal)
ufmt format (examples|test|torchmultimodal)
Alternatively, you can run on only those files you have modified, e.g.
flake8 `git diff main --name-only`
ufmt format `git diff main --name-only`
TorchMultimodal uses mypy for type checking. To perform type checking:
# on the whole repo
mypy
## only on modified files
mypy `git diff main --name-only`
Please add unit tests for adding a new feature or a bug-fix.
Note: we are migrating from unitest
to pytest
.
Please write your tests in pytest to help us with the transition.
To run a specific test:
pytest tests/<test-module.py> -vv -k <test_myfunc>
# e.g. pytest tests/models/test_cnn_lstm.py -vv -k TestCNNLSTMModule
To run all tests:
pytest tests -vv
By contributing to TorchMultimodal, you agree that your contributions will be licensed under the LICENSE file in the root directory of this source tree.