Last active
July 11, 2023 19:47
-
-
Save 1a1a11a/65be1a8623a6c32c91668c1058c9172e to your computer and use it in GitHub Desktop.
download_llama
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
PRESIGNED_URL="https://agi.gpt4.org/llama/LLaMA/*" | |
MODEL_SIZE="7B,13B,30B,65B" # edit this list with the model sizes you wish to download | |
TARGET_FOLDER="models/" # where all files should end up | |
mkdir -p ${TARGET_FOLDER} || true | |
declare -A N_SHARD_DICT | |
N_SHARD_DICT["7B"]="0" | |
N_SHARD_DICT["13B"]="1" | |
N_SHARD_DICT["30B"]="3" | |
N_SHARD_DICT["65B"]="7" | |
echo "Downloading tokenizer" | |
wget ${PRESIGNED_URL/'*'/"tokenizer.model"} -O ${TARGET_FOLDER}"/tokenizer.model" | |
wget ${PRESIGNED_URL/'*'/"tokenizer_checklist.chk"} -O ${TARGET_FOLDER}"/tokenizer_checklist.chk" | |
(cd ${TARGET_FOLDER} && md5sum -c tokenizer_checklist.chk) | |
for i in ${MODEL_SIZE//,/ }; do | |
echo "Downloading ${i}" | |
mkdir -p ${TARGET_FOLDER}"/${i}" | |
for s in $(seq -f "0%g" 0 ${N_SHARD_DICT[$i]}); do | |
echo wget ${PRESIGNED_URL/'*'/"${i}/consolidated.${s}.pth"} -O ${TARGET_FOLDER}"/${i}/consolidated.${s}.pth" >> /tmp/task; | |
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" | |
done | |
sudo apt-get install -yqq parallel; | |
parallel -j4 < /tmp/task; | |
echo "Checking checksums" | |
for i in ${MODEL_SIZE//,/ }; | |
(cd ${TARGET_FOLDER}"/${i}" && md5sum -c checklist.chk) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment