Skip to content

Commit

Permalink
add pre-commit in CONTRIBUTING.md (#78)
Browse files Browse the repository at this point in the history
Co-authored-by: Bowen12992 <[email protected]>
  • Loading branch information
Bowen12992 and Bowen12992 committed Jun 19, 2024
1 parent 63e0112 commit 7b16f88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand Down
2 changes: 1 addition & 1 deletion tests/test_special_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 7b16f88

Please sign in to comment.