Skip to content

Training Workflow

Training Workflow #96

name: NVIDIA PyTorch Job
on:
workflow_dispatch:
inputs:
script_content:
description: 'Content of train.py'
required: true
type: string
jobs:
train:
runs-on: [gpumode-nvidia-arc]
container:
image: nvidia/cuda:12.4.0-devel-ubuntu22.04
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install numpy
pip install torch
- name: Create training script
shell: python
run: |
with open('train.py', 'w') as f:
f.write('''${{ github.event.inputs.script_content }}''')
- name: Run training script
run: |
python train.py > training.log 2>&1
- name: Upload logs
uses: actions/upload-artifact@v3
if: always()
with:
name: training-logs
path: training.log