-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.67 KB
/
cml_dvc_cache.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: DVC & train-my-model (cache)
on: [push]
jobs:
run:
runs-on: [ubuntu-latest]
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
pytorch-version: ["1.12.0"]
steps:
- uses: actions/checkout@v2
- uses: iterative/setup-cml@v1
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ matrix.os }}-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_tests.txt
- uses: iterative/setup-dvc@v1
- name: Get data
run: dvc pull
env:
GDRIVE_CREDENTIALS_DATA: ${{ secrets.GDRIVE_CREDENTIALS_DATA }}
- name: Train model
run: |
python cnn_mnist/train_cml.py # run training
- name: Write report
env:
# this authenticates that the right permissions are in place
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# send all information to report.md that will be reported to us when the workflow finish
cat classification_report.txt >> report.md
cml-publish confusion_matrix.png --md >> report.md
cml-send-comment report.md