Skip to content

Commit

Permalink
Add dependency stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
msaroufim committed Nov 5, 2024
1 parent c1e2b1a commit 311a098
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/train_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,49 @@
name: Training Workflow

on:
workflow_dispatch:
inputs:
script_content:
description: 'Content of train.py'
required: true
type: string # Explicitly specify the type
type: string

jobs:
train:
runs-on: ubuntu-latest

steps:
- name: "Install uv"
uses: astral-sh/setup-uv@v3

# Cache PyTorch dependencies
- name: Cache PyTorch
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-torch-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-torch-
# Create requirements.txt
- name: Create requirements file
run: |
cat << EOF > requirements.txt
numpy==1.24.3
torch==2.1.0
EOF
# Install dependencies using uv
- name: Install dependencies
run: |
pip install numpy
# pip install torch - need to find a way to cache this otherwise it will take a long time to install
uv pip install -r requirements.txt
- name: Create and run training script
run: |
echo "${{ inputs.script_content }}" > train.py
cat train.py # Debug: print the content
python train.py > training.log 2>&1
- name: Upload logs
uses: actions/upload-artifact@v3
if: always() # Upload logs whether the job succeeds or fails
Expand Down

0 comments on commit 311a098

Please sign in to comment.