From 8b42a1513b075a2c3b924ae65638e5987c419bf6 Mon Sep 17 00:00:00 2001 From: Christian Haschek Date: Sun, 12 Mar 2023 22:30:42 +0100 Subject: [PATCH] skip existing pth files Checks for the existing files before downloading. good if you cancelled the download and have to re-run the script --- llama.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llama.sh b/llama.sh index 6308ce0..3e6afcb 100755 --- a/llama.sh +++ b/llama.sh @@ -30,7 +30,12 @@ do mkdir -p ${TARGET_FOLDER}"/${i}" for s in $(seq -f "0%g" 0 ${N_SHARD_DICT[$i]}) do - wget ${PRESIGNED_URL/'*'/"${i}/consolidated.${s}.pth"} -O ${TARGET_FOLDER}"/${i}/consolidated.${s}.pth" + if [ -s ${TARGET_FOLDER}"/${i}/consolidated.${s}.pth" ] + then + echo "Skipping ${TARGET_FOLDER}/${i}/consolidated.${s}.pth" + else + wget ${PRESIGNED_URL/'*'/"${i}/consolidated.${s}.pth"} -O ${TARGET_FOLDER}"/${i}/consolidated.${s}.pth" + fi done wget ${PRESIGNED_URL/'*'/"${i}/params.json"} -O ${TARGET_FOLDER}"/${i}/params.json" wget ${PRESIGNED_URL/'*'/"${i}/checklist.chk"} -O ${TARGET_FOLDER}"/${i}/checklist.chk"