Skip to content

Commit d9a3acd

Browse files
authored
separate job down dataset
1 parent d6a520a commit d9a3acd

1 file changed

Lines changed: 36 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,41 @@ jobs:
320320
git push origin master
321321
fi
322322
323+
download-dataset:
324+
runs-on: ubuntu-latest
325+
steps:
326+
- uses: actions/checkout@v4
327+
- name: Cache ImageNet-Paste dataset
328+
id: cache-imagenet
329+
uses: actions/cache@v4
330+
with:
331+
path: docs/ImageNet
332+
key: imagenet-paste-v1-${{ hashFiles('app/Converters/download_imagenet.py') }}
333+
restore-keys: |
334+
imagenet-paste-v1-
335+
imagenet-paste-
336+
337+
- name: Download ImageNet-Paste dataset
338+
if: steps.cache-imagenet.outputs.cache-hit != 'true'
339+
env:
340+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
341+
run: |
342+
mkdir -p docs/ImageNet/test
343+
cd app/Converters
344+
python download_imagenet.py
345+
cd ../..
346+
347+
- name: Upload dataset as artifact
348+
if: steps.cache-imagenet.outputs.cache-hit != 'true'
349+
uses: actions/upload-artifact@v4
350+
with:
351+
name: imagenet-dataset
352+
path: docs/ImageNet
353+
retention-days: 1
354+
323355
evaluate-models-onnx:
324356
runs-on: ubuntu-latest
325-
needs: [build-linux]
357+
needs: [build-linux, download-dataset]
326358
permissions:
327359
contents: write
328360
strategy:
@@ -411,31 +443,11 @@ jobs:
411443
python ${{ matrix.parser }} ${{ matrix.model }}
412444
cd ../..
413445
414-
- name: Cache ImageNet-Paste dataset
415-
id: cache-imagenet-restore
416-
uses: actions/cache/restore@v4
417-
with:
418-
path: docs/ImageNet
419-
key: imagenet-paste-v1-${{ hashFiles('app/Converters/download_imagenet.py') }}
420-
restore-keys: |
421-
imagenet-paste-v1-
422-
imagenet-paste-
423-
424-
- name: Download ImageNet-Paste dataset
425-
if: steps.cache-imagenet-restore.outputs.cache-hit != 'true'
426-
env:
427-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
428-
run: |
429-
mkdir -p docs/ImageNet/test
430-
cd app/Converters
431-
python download_imagenet.py
432-
cd ../..
433-
434-
- name: Save ImageNet-Paste dataset
435-
uses: actions/cache/save@v4
446+
- name: Download dataset artifact
447+
uses: actions/download-artifact@v4
436448
with:
449+
name: imagenet-dataset
437450
path: docs/ImageNet
438-
key: imagenet-paste-v1-${{ hashFiles('app/Converters/download_imagenet.py') }}
439451

440452
- name: Prepare environment
441453
run: |

0 commit comments

Comments
 (0)