Skip to content

Commit 95b8114

Browse files
committed
add a limit to the download loop
1 parent 02695f5 commit 95b8114

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/test_install.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ jobs:
1919
run: pip install .[cli,dev]
2020
- name: Test installation with pytest
2121
run: |
22-
rembg d
23-
while [ $? -ne 0 ]; do !!; done
22+
attempt=0
23+
until rembg d || [ $attempt -eq 5 ]; do
24+
attempt=$((attempt+1))
25+
echo "Attempt $attempt to download the models..."
26+
done
27+
if [ $attempt -eq 5 ]; then
28+
echo "downloading the models failed 5 times, exiting..."
29+
exit 1
30+
fi
2431
pytest

0 commit comments

Comments
 (0)