-
Notifications
You must be signed in to change notification settings - Fork 11
42 lines (36 loc) · 1.23 KB
/
run_tutorials.yml
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
name: Run Tutorials
on:
push:
branches:
- main
release:
types: [ published ]
jobs:
build:
name: Run Tutorials
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Modify notebook parameters
run: |
# Replace parameters to reduce exec time of 07_gradient_descent
sed -i 's/batch_size = 4/batch_size = 1/' docs/tutorials/07_gradient_descent.ipynb
sed -i 's/for epoch in range(10):/for epoch in range(1):/' docs/tutorials/07_gradient_descent.ipynb
sed -i 's/inputs = jnp.asarray(np.random.rand(100, 2))/inputs = jnp.asarray(np.random.rand(3, 2))/' docs/tutorials/07_gradient_descent.ipynb
sed -i 's/t_max = 5.0/t_max = 3.0/' docs/tutorials/07_gradient_descent.ipynb
- name: Test notebooks
run: |
for notebook in docs/tutorials/*.ipynb; do
echo "Testing $notebook"
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=600 "$notebook"
done