diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c5f5b3a..2fd6b023 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,14 @@ Please report bugs using Github's issues. When reporting bugs, please provide In pull requests, contributor should describe what changed and why. Please also provide test cases if applicable. Pull requests require approvals from two members before merging. +Using pre-commit git hooks with FlagGems, you can format source Python code and perform basic code pre-checks when calling the git commit command + +```bash +pip install pre-commit +pre-commit install +pre-commit +``` + ## Project Structure ``` diff --git a/tests/test_special_ops.py b/tests/test_special_ops.py index 6966caa1..a907d453 100644 --- a/tests/test_special_ops.py +++ b/tests/test_special_ops.py @@ -57,7 +57,7 @@ def get_rope_cos_sin(max_seq_len, dim, dtype, base=10000, device="cuda"): def rotate_half(x): """Rotates half the hidden dims of the input.""" x1 = x[..., : x.shape[-1] // 2] - x2 = x[..., x.shape[-1] // 2 :] # noqa: E203 + x2 = x[..., x.shape[-1] // 2 :] return torch.cat((-x2, x1), dim=-1)