Skip to content

feat: gpt shakespeare workflow #1

feat: gpt shakespeare workflow

feat: gpt shakespeare workflow #1

name: Train GPT-Shakespear on AWS

Check failure on line 1 in .github/workflows/gpt_shakespear_experiment.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/gpt_shakespear_experiment.yml

Invalid workflow file

you may only define up to 10 `inputs` for a `workflow_dispatch` event
on:
workflow_dispatch:
inputs:
environment:
description: 'Loss Function'
required: true
default: 'CrossEntropyLoss'
type: choice
options:
- 'CrossEntropyLoss'
number_of_heads:
description: 'The number of attention heads per self attention module.'
required: true
type: string
default: '12'
number_of_blocks:
description: 'The number of transformer blocks.'
required: true
type: string
default: '2'
coordinates:
description: 'The word embedding dimension.'
required: true
type: string
default: '9'
words:
description: 'The number of tokens in the input sequence.'
required: true
type: string
default: '11'
tokens:
description: 'The number of tokens in the vocab.'
required: true
type: string
default: '3'
bias:
description: 'Whether to use bias in the linear layers.'
required: true
type: string
default: 'True'
batch_size:
description: 'The batch size.'
required: true
type: string
default: '32'
number_of_batches:
description: 'The number of batches.'
required: true
type: string
default: '32'
number_of_epochs:
description: 'The number of epochs.'
required: true
type: string
default: '20'
learning_rate:
description: 'The learning rate (fixed).'
required: true
type: string
default: '0.001'
ami_id:
description: 'The ami id.'
required: true
type: string
default: 'ami-093cb9fb2d34920ad'
instance_type:
description: 'The instance type.'
required: true
type: string
default: 'c5n.xlarge'
permissions:
contents: read
jobs:
training:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install awscli boto3==1.34.8 pydantic==2.5.3 pydantic-settings==2.1.0 mlflow==2.9.2
- name: Babysit Experiment
run: |
export MLFLOW_TRACKING_URL=${{ secrets.MLFLOW_TRACKING_URI }}
export MLFLOW_TRACKING_USERNAME=${{ secrets.MLFLOW_TRACKING_USERNAME }}
export MLFLOW_TRACKING_PASSWORD=${{ secrets.MLFLOW_TRACKING_PASSWORD }}
export MLFLOW_EXPERIMENT_ID=${{ secrets.MLFLOW_EXPERIMENT_ID }}
export AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}
export REGION_NAME=eu-west-2
export AMI_ID=${{ github.event.inputs.ami_id }}
export INSTANCE_TYPE=${{ github.event.inputs.instance_type }}
export COORDINATES=${{ github.event.inputs.coordinates }}
export TOKENS=${{ github.event.inputs.tokens }}
export WORDS=${{ github.event.inputs.words }}
export NUMBER_OF_BLOCKS=${{ github.event.inputs.number_of_blocks }}
export LOSS_FUNCTION=${{ github.event.inputs.environment }}
export NUMBER_OF_HEADS=${{ github.event.inputs.number_of_heads }}
export BIAS=${{ github.event.inputs.bias }}
export BATCH_SIZE=${{ github.event.inputs.batch_size }}
export NUMBER_OF_BATCHES=${{ github.event.inputs.number_of_batches }}
export NUMBER_OF_EPOCHS=${{ github.event.inputs.number_of_epochs }}
export LEARNING_RATE=${{ github.event.inputs.learning_rate }}
cd gpt_shakespear
python train_main.py