Skip to content

Commit

Permalink
chore: setup environment (#1)
Browse files Browse the repository at this point in the history
* chore: add DevContainer

* chore(deps): add dependancies

* ci: setup CI
  • Loading branch information
rmuraix authored Nov 7, 2024
1 parent 837de85 commit c9fbdfe
Show file tree
Hide file tree
Showing 7 changed files with 2,775 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04

RUN sed -i 's@archive.ubuntu.com@ftp.jaist.ac.jp/pub/Linux@g' /etc/apt/sources.list

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "cs231n-py3-gpu",
"build": {
"dockerfile": "./Dockerfile"
},
"runArgs": ["--gpus", "all","--shm-size","8g"],
"containerEnv": {
"TZ": "Asia/Tokyo"
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": false,
"installOhMyZsh": false,
"installOhMyZshConfig": false,
"upgradePackages": false,
"username": "vscode",
"userUid": "automatic",
"userGid": "automatic"
}
},
"postStartCommand": "uv sync",
"remoteUser": "vscode",
"customizations": {
"vscode": {
"extensions": [
"ms-toolsai.jupyter",
"charliermarsh.ruff",
"tamasfe.even-better-toml",
"mhutchie.git-graph",
"redhat.vscode-yaml"
]
}
}
}
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install dependencies
run: uv sync
- name: Check code format
run: uv run ruff format --check .
- name: Chack matadata
run: |
uv run nbdev_clean
git add .
git diff --name-only --exit-code
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# uv
.venv/

# ruff
.ruff_cache/

# model
checkpoint-*/
src/**/*config.json
*.safetensors
*.bin
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[project]
name = "hf-hands-on"
version = "0.1.0"
description = "play with huggingface"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"accelerate==1.1.1",
"albumentations==1.4.21",
"datasets==3.0.2",
"evaluate==0.4.3",
"nbdev==2.3.31",
"numpy==1.26.4",
"pandas==2.2.3",
"pillow==11.0.0",
"scikit-learn==1.5.2",
"torch==2.3.0",
"torchvision==0.18.0",
"transformers==4.46.1",
]

[dependency-groups]
dev = [
"ipykernel>=6.29.5",
"ipywidgets>=8.1.5",
"nbdev>=2.3.31",
"ruff>=0.7.1",
"setuptools>=75.3.0",
]
2,666 changes: 2,666 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit c9fbdfe

Please sign in to comment.