File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ sudo apt-get install -y --no-install-recommends unzip p7zip-full sox libsox-dev
18
18
# NS: Path to python runtime should already be part of docker container
19
19
# export PATH=/opt/conda/bin:$PATH
20
20
rm -rf src
21
- # NS: ghstack is not needed to build tutorials and right now it forces importlib to be downgraded to 3.X
21
+ # NS: ghstack is not needed to build tutorials and right now it forces importlib to be downgraded to 3.X
22
22
pip uninstall -y ghstack
23
23
pip install --progress-bar off -r $DIR /../requirements.txt
24
24
@@ -56,12 +56,11 @@ if [[ "${JOB_TYPE}" == "worker" ]]; then
56
56
# Step 2: Keep certain tutorials based on file count, and remove runnable code in all other tutorials
57
57
# IMPORTANT NOTE: We assume that each tutorial has a UNIQUE filename.
58
58
FILES_TO_RUN=$( python .jenkins/get_files_to_run.py)
59
- echo " FILES_TO_RUN: " ${FILES_TO_RUN}
60
59
# Files to run must be accessible to subprocessed (at least to `download_data.py`)
61
60
export FILES_TO_RUN
62
61
63
- # Step 3: Run ` make docs` to generate HTML files and static files for these tutorials
64
- make docs
62
+ make download
63
+ python .jenkins/sphinx_files.py
65
64
66
65
# Step 4: If any of the generated files are not related the tutorial files we want to run,
67
66
# then we remove them
Original file line number Diff line number Diff line change
1
+ import subprocess
2
+ import os
3
+
4
+
5
+ def main () -> None :
6
+ files_to_run = os .environ ["FILES_TO_RUN" ]
7
+ env = os .environ .copy ()
8
+ for file in files_to_run .split (" " ):
9
+ print (f"Running { file } " )
10
+ env ["GALLERY_PATTERN" ] = file
11
+ subprocess .check_output (["make" , "html" ], env = env )
12
+
13
+
14
+ if __name__ == "__main__" :
15
+ main ()
Original file line number Diff line number Diff line change @@ -254,8 +254,9 @@ def to_numpy(tensor):
254
254
255
255
from PIL import Image
256
256
import torchvision .transforms as transforms
257
+ import os
257
258
258
- img = Image .open (" ./_static/img/cat.jpg" )
259
+ img = Image .open (os . cwd () + ". ./_static/img/cat.jpg" )
259
260
260
261
resize = transforms .Resize ([224 , 224 ])
261
262
img = resize (img )
You can’t perform that action at this time.
0 commit comments