File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -324,37 +324,39 @@ jobs:
324324 runs-on : ubuntu-latest
325325 steps :
326326 - 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
333- restore-keys : |
334- imagenet-paste-v1-
335- imagenet-paste-
336-
327+
328+ - name : Check if dataset exists in artifacts
329+ id : check-artifact
330+ run : |
331+ if [ -d " docs/ImageNet/test" ] && [ "$(ls -A docs/ImageNet/test 2>/dev/null)" ]; then
332+ echo "exists=true" >> $GITHUB_OUTPUT
333+ else
334+ echo "exists=false" >> $GITHUB_OUTPUT
335+ fi
336+
337337 - name : Setup Python
338+ if : steps.check-artifact.outputs.exists != 'true'
338339 uses : actions/setup-python@v4
339340 with :
340341 python-version : ' 3.10'
341342
342- - name : Install Python dependencies from requirements.txt
343+ - name : Install Python dependencies
344+ if : steps.check-artifact.outputs.exists != 'true'
343345 run : |
344346 cd app/Converters
345347 pip install -r requirements.txt
346348 cd ../..
347349
348350 - name : Download ImageNet-Paste dataset
349- if : steps.cache-imagenet .outputs.cache-hit != 'true'
351+ if : steps.check-artifact .outputs.exists != 'true'
350352 env :
351353 HF_TOKEN : ${{ secrets.HF_TOKEN }}
352354 run : |
353355 mkdir -p docs/ImageNet/test
354356 cd app/Converters
355357 python download_imagenet.py
356358 cd ../..
357-
359+
358360 - name : Upload dataset as artifact
359361 uses : actions/upload-artifact@v4
360362 with :
You can’t perform that action at this time.
0 commit comments