Skip to content

Commit 03c9c1b

Browse files
author
Yi-01-ai
committed
init
0 parents  commit 03c9c1b

31 files changed

+6385
-0
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.git/
2+
.venv/
3+
venv/

.github/workflows/ci.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
basic-check:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: ["3.10"]
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: 01-ai/actions/lint@main
24+
25+
build-and-push:
26+
needs: basic-check
27+
runs-on:
28+
- arc
29+
- cpu
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
- name: Set proxy
34+
run: |
35+
echo "http_proxy=$http_proxy" >> $GITHUB_ENV
36+
echo "https_proxy=$https_proxy" >> $GITHUB_ENV
37+
- uses: 01-ai/actions/build_docker_image@main
38+
id: build-and-push
39+
with:
40+
registry: ${{ vars.VOLCES_REGISTRY }}
41+
namespace: ${{ vars.VOLCES_NAMESPACE }}
42+
tags: 'latest'
43+
username: ${{ secrets.VOLCES_USER }}
44+
password: ${{ secrets.VOLCES_TOKEN }}

.gitignore

+168
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
.vscode/*
2+
3+
# Local History for Visual Studio Code
4+
.history/
5+
6+
# Built Visual Studio Code Extensions
7+
*.vsix
8+
9+
# Byte-compiled / optimized / DLL files
10+
__pycache__/
11+
*.py[cod]
12+
*$py.class
13+
14+
# C extensions
15+
*.so
16+
17+
# Distribution / packaging
18+
.Python
19+
build/
20+
develop-eggs/
21+
dist/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
lib/
26+
lib64/
27+
parts/
28+
sdist/
29+
var/
30+
wheels/
31+
share/python-wheels/
32+
*.egg-info/
33+
.installed.cfg
34+
*.egg
35+
MANIFEST
36+
37+
# PyInstaller
38+
# Usually these files are written by a python script from a template
39+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
40+
*.manifest
41+
*.spec
42+
43+
# Installer logs
44+
pip-log.txt
45+
pip-delete-this-directory.txt
46+
47+
# Unit test / coverage reports
48+
htmlcov/
49+
.tox/
50+
.nox/
51+
.coverage
52+
.coverage.*
53+
.cache
54+
nosetests.xml
55+
coverage.xml
56+
*.cover
57+
*.py,cover
58+
.hypothesis/
59+
.pytest_cache/
60+
cover/
61+
62+
# Translations
63+
*.mo
64+
*.pot
65+
66+
# Django stuff:
67+
*.log
68+
local_settings.py
69+
db.sqlite3
70+
db.sqlite3-journal
71+
72+
# Flask stuff:
73+
instance/
74+
.webassets-cache
75+
76+
# Scrapy stuff:
77+
.scrapy
78+
79+
# Sphinx documentation
80+
docs/_build/
81+
82+
# PyBuilder
83+
.pybuilder/
84+
target/
85+
86+
# Jupyter Notebook
87+
.ipynb_checkpoints
88+
89+
# IPython
90+
profile_default/
91+
ipython_config.py
92+
93+
# pyenv
94+
# For a library or package, you might want to ignore these files since the code is
95+
# intended to run in multiple environments; otherwise, check them in:
96+
# .python-version
97+
98+
# pipenv
99+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
101+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
102+
# install all needed dependencies.
103+
#Pipfile.lock
104+
105+
# poetry
106+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
107+
# This is especially recommended for binary packages to ensure reproducibility, and is more
108+
# commonly ignored for libraries.
109+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
110+
#poetry.lock
111+
112+
# pdm
113+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114+
#pdm.lock
115+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
116+
# in version control.
117+
# https://pdm.fming.dev/#use-with-ide
118+
.pdm.toml
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
#.idea/

.pre-commit-config.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 23.7.0
4+
hooks:
5+
- id: black
6+
# It is recommended to specify the latest version of Python
7+
# supported by your project here, or alternatively use
8+
# pre-commit's default_language_version, see
9+
# https://pre-commit.com/#top_level-default_language_version
10+
language_version: python3.10
11+
- repo: https://github.com/pycqa/isort
12+
rev: 5.12.0
13+
hooks:
14+
- id: isort
15+
name: isort (python)
16+
args: ["--profile", "black", "--filter-files"]
17+
- repo: https://github.com/PyCQA/autoflake
18+
rev: v2.2.1
19+
hooks:
20+
- id: autoflake
21+
args: [--remove-all-unused-imports, --remove-unused-variables, --expand-star-imports, --ignore-init-module-imports, -r, --in-place]

Dockerfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ARG REGISTRY="nvcr.io"
2+
ARG CUDA_VERSION="11.8.0"
3+
FROM ${REGISTRY}/nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 as base
4+
5+
ARG MAX_JOBS=8
6+
7+
RUN apt update \
8+
&& apt install -y python3-pip python3-packaging git ninja-build \
9+
&& pip3 install -U pip \
10+
&& ln -s /usr/bin/python3 /usr/bin/python
11+
12+
WORKDIR /yi
13+
14+
RUN pip3 install torch==2.0.1 \
15+
&& pip3 install flash-attn==2.3.3 --no-build-isolation
16+
17+
COPY ./requirements.txt .
18+
RUN pip3 install -r requirements.txt
19+
20+
COPY . .

0 commit comments

Comments
 (0)