Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup environment #1

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.