Merge branch 'main' of https://github.com/Pankaj-sk/ERA-V3 #18
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MNIST Model Tests | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --index-url https://download.pytorch.org/whl/cpu torch torchvision --no-cache-dir | |
pip install pytest | |
- name: Check Model Parameters | |
run: | | |
cd mnist_project | |
python -m pytest src/tests/test_model.py::test_model_parameters -v | |
- name: Train and Test Model | |
run: | | |
cd mnist_project/src | |
python train.py | |
cd .. | |
python -m pytest src/tests/test_training.py::test_model_accuracy -v | |
- name: Upload model artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: trained-model | |
path: mnist_project/src/model_mnist_*.pth |