Skip to content

Add github actions

Add github actions #1

name: PyTorch CI
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.10, 3.11] # Define multiple Python versions if needed
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip3 install torch numpy transformers datasets tiktoken wandb tensorboard tqdm
- name: Run PyTorch training test
run: |
python3 train.py --device=cpu --eval_iters=1 --log_interval=1 --block_size=8 --batch_size=8 --n_layer=2 --n_head=2 --n_embd=16 --max_iters=2 --lr_decay_iters=2 --dropout=0.0