Skip to content

Commit 3e6243b

Browse files
author
pax-sun
committed
init
0 parents  commit 3e6243b

868 files changed

Lines changed: 264739 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[flake8]
2+
# Suggested config from pytorch that we can adapt
3+
select = B,C,E,F,N,P,T4,W,B9,TOR0,TOR1,TOR2
4+
max-line-length = 120
5+
# C408 ignored because we like the dict keyword argument syntax
6+
# E501 is not flexible enough, we're using B950 instead
7+
# N812 ignored because import torch.nn.functional as F is PyTorch convention
8+
# N817 ignored because importing using acronyms is convention (DistributedDataParallel as DDP)
9+
# E731 allow usage of assigning lambda expressions
10+
ignore =
11+
E203,E305,E402,E501,E721,E741,F405,F821,F841,F999,W503,W504,C408,E302,W291,E303,N812,N817,E731
12+
# shebang has extra meaning in fbcode lints, so I think it's not worth trying
13+
# to line this up with executable bit
14+
EXE001,
15+
# these ignores are from flake8-bugbear; please fix!
16+
B007,B008,
17+
optional-ascii-coding = True
18+
exclude =
19+
./.git,
20+
./docs
21+
./build
22+
./scripts,
23+
./venv,
24+
*.pyi
25+
.pre-commit-config.yaml
26+
*.md
27+
.flake8
28+
tests/torchtune/models/llama2/scripts/*.py

.gitignore

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# Derived from basic .gitignore template for python projects:
2+
# https://github.com/github/gitignore/blob/main/Python.gitignore
3+
# Please maintain the alphabetic order of the section titles
4+
# To debug why a file is being ignored, use the command:
5+
# git check-ignore -v $my_ignored_file
6+
7+
# Byte-compiled / optimized / DLL files
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
12+
# C extensions
13+
*.so
14+
15+
# Cython debug symbols
16+
cython_debug/
17+
18+
# Celery stuff
19+
celerybeat-schedule
20+
celerybeat.pid
21+
22+
# Distribution / packaging
23+
.Python
24+
build/
25+
develop-eggs/
26+
dist/
27+
downloads/
28+
eggs/
29+
.eggs/
30+
lib/
31+
lib64/
32+
parts/
33+
sdist/
34+
var/
35+
wheels/
36+
share/python-wheels/
37+
*.egg-info/
38+
.installed.cfg
39+
*.egg
40+
MANIFEST
41+
42+
# Django stuff
43+
*.log
44+
local_settings.py
45+
db.sqlite3
46+
db.sqlite3-journal
47+
48+
# Environments
49+
.env
50+
.venv
51+
env/
52+
venv/
53+
ENV/
54+
env.bak/
55+
venv.bak/
56+
57+
# Flask stuff
58+
instance/
59+
.webassets-cache
60+
61+
# Installer logs
62+
pip-log.txt
63+
pip-delete-this-directory.txt
64+
65+
# IPython
66+
profile_default/
67+
ipython_config.py
68+
69+
# Jupyter Notebook
70+
*.ipynb_checkpoints
71+
72+
# mkdocs documentation
73+
/site
74+
75+
# Model saving / checkpointing
76+
*.pt
77+
*.pth
78+
*.ckpt
79+
*.json.gz
80+
81+
# mypy
82+
.mypy_cache/
83+
.dmypy.json
84+
dmypy.json
85+
86+
# PyBuilder
87+
.pybuilder/
88+
target/
89+
90+
# PyCharm
91+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
92+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
93+
# and can be added to the global gitignore or merged into this file. For a more nuclear
94+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
95+
#.idea/
96+
97+
# PyInstaller
98+
# Usually these files are written by a python script from a template
99+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
100+
*.manifest
101+
*.spec
102+
103+
# pyenv
104+
# For a library or package, you might want to ignore these files since the code is
105+
# intended to run in multiple environments; otherwise, check them in:
106+
# .python-version
107+
108+
# pipenv
109+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
110+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
111+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
112+
# install all needed dependencies.
113+
# Pipfile.lock
114+
115+
# poetry
116+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
117+
# This is especially recommended for binary packages to ensure reproducibility, and is more
118+
# commonly ignored for libraries.
119+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
120+
# poetry.lock
121+
122+
# PEP 582: https://peps.python.org/pep-0582/
123+
# This PEP proposes to add to Python a mechanism to automatically recognize a __pypackages__
124+
# directory and prefer importing packages installed in this location over user or global site-packages.
125+
# This will avoid the steps to create, activate or deactivate virtual environments. Python will use
126+
# the __pypackages__ from the base directory of the script when present.
127+
__pypackages__/
128+
129+
# Pyre type checker
130+
.pyre/
131+
132+
# pytype static type analyzer
133+
.pytype/
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# SageMath parsed files
139+
*.sage.py
140+
141+
# Scrapy stuff:
142+
.scrapy
143+
144+
# Sphinx documentation
145+
docs/build
146+
# sphinx-gallery
147+
docs/source/generated_examples/
148+
docs/source/gen_modules/
149+
docs/source/generated/
150+
docs/source/sg_execution_times.rst
151+
# pytorch-sphinx-theme gets installed here
152+
docs/src
153+
154+
# Spyder project settings
155+
.spyderproject
156+
.spyproject
157+
158+
# System / program generated files
159+
*.err
160+
*.log
161+
*.swp
162+
.DS_Store
163+
164+
# Translations
165+
*.mo
166+
*.pot
167+
168+
# TorchX
169+
*.torchxconfig
170+
171+
# Unit test / coverage reports
172+
htmlcov/
173+
.tox/
174+
.nox/
175+
.coverage
176+
.coverage.*
177+
.cache
178+
nosetests.xml
179+
coverage.xml
180+
*.cover
181+
*.py,cover
182+
.hypothesis/
183+
.pytest_cache/
184+
cover/
185+
186+
# VSCode
187+
.vscode/
188+
189+
# wandb
190+
wandb/
191+
192+
# RUN
193+
*RUN/

.pre-commit-config.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
exclude: 'build'
2+
3+
default_language_version:
4+
python: python3
5+
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v5.0.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: check-ast
12+
- id: check-merge-conflict
13+
- id: no-commit-to-branch
14+
args: ['--branch=main']
15+
- id: check-added-large-files
16+
args: ['--maxkb=1000']
17+
- id: end-of-file-fixer
18+
exclude: '^(.*\.svg)$'
19+
20+
- repo: https://github.com/pycqa/flake8
21+
rev: 7.1.1
22+
hooks:
23+
- id: flake8
24+
additional_dependencies:
25+
- flake8-bugbear == 22.4.25
26+
- pep8-naming == 0.12.1
27+
- torchfix
28+
args: ['--config=.flake8']
29+
30+
- repo: https://github.com/omnilib/ufmt
31+
rev: v2.8.0
32+
hooks:
33+
- id: ufmt
34+
additional_dependencies:
35+
- black == 22.12.0
36+
- usort == 1.0.5
37+
38+
- repo: https://github.com/jsh9/pydoclint
39+
rev: 0.5.12
40+
hooks:
41+
- id: pydoclint
42+
args: [--config=pyproject.toml]

0 commit comments

Comments
 (0)