Skip to content

Instantly share code, notes, and snippets.

@hajowieland
Last active February 23, 2024 19:35
Show Gist options
  • Save hajowieland/7a61db65bd473757fafc657fd82db503 to your computer and use it in GitHub Desktop.
Save hajowieland/7a61db65bd473757fafc657fd82db503 to your computer and use it in GitHub Desktop.
download_models.sh
#!/bin/bash
cd /models || exit
# Define available models
declare -a available_models=("codellama-34b-instruct.Q4_0.gguf" "llama-2-13b-chat.ggmlv3.q4_0.bin" "llama-2-13b-chat.Q4_0.gguf" "llama-2-70b-chat.ggmlv3.q4_0.bin" "llama-2-70b-chat.Q4_0.gguf")
# Display available models to user
echo "Available LLM models:"
for model in "${available_models[@]}"; do
echo "- $model"
done
# Prompt the user for input
read -p "Enter the LLM models to download: " models
IFS=',' read -ra ADDR <<< "$models"
for model in "${ADDR[@]}"; do
# Check model and download appropriate URLs
if [[ "$model" == "codellama-34b-instruct.Q4_0.gguf" ]]; then
urls=("https://huggingface.co/TheBloke/CodeLlama-34B-Instruct-GGUF/resolve/main/codellama-34b-instruct.Q4_0.gguf" "https://gist.githubusercontent.com/hajowieland/7599e438892e4ca4bb02dac3992f54f6/raw/0957cb3331c591d86ec7e443c584ef19ef1fe8ba/codellama-34b-instruct.yaml" "https://gist.githubusercontent.com/hajowieland/f8093f4583652f7ddb685c7c7f7b03e9/raw/ed6ada13b21dd0c808152634a89f10d0f8f7f67e/llama2-chat-message.tmpl")
elif [[ "$model" == "llama-2-13b-chat.Q4_0.gguf" ]]; then
urls=("https://huggingface.co/TheBloke/Llama-2-13B-chat-GGUF/resolve/main/llama-2-13b-chat.Q4_0.gguf" "https://gist.githubusercontent.com/hajowieland/939b2a6780c31e8bf39e502ecc608d6e/raw/8de60c043cad62b799cd31817903e43495b18305/llama2-13b-chat.yaml" "https://gist.githubusercontent.com/hajowieland/f8093f4583652f7ddb685c7c7f7b03e9/raw/ed6ada13b21dd0c808152634a89f10d0f8f7f67e/llama2-chat-message.tmpl")
elif [[ "$model" == "llama-2-13b-chat.ggmlv3.q4_0.bin" ]]; then
urls=("https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/llama-2-13b-chat.ggmlv3.q4_0.bin" "https://gist.githubusercontent.com/hajowieland/ea0ac711b5bb8692d069593ef2d37e43/raw/202ac22b6f0bf7f8666befa73cf086dcb7f3e13f/lama2-13b-chat.yaml" "https://gist.githubusercontent.com/hajowieland/f8093f4583652f7ddb685c7c7f7b03e9/raw/ed6ada13b21dd0c808152634a89f10d0f8f7f67e/llama2-chat-message.tmpl")
elif [[ "$model" == "llama-2-70b-chat.Q4_0.gguf" ]]; then
urls=("https://huggingface.co/TheBloke/Llama-2-70B-chat-GGUF/resolve/main/llama-2-70b-chat.Q4_0.gguf" "https://gist.githubusercontent.com/hajowieland/3e5732a4f7c2b6195616c9d85dcd3690/raw/84756119f6e853923444391a78b054bba3f887e2/llama2-70b-chat.yaml" "https://gist.githubusercontent.com/hajowieland/f8093f4583652f7ddb685c7c7f7b03e9/raw/ed6ada13b21dd0c808152634a89f10d0f8f7f67e/llama2-chat-message.tmpl")
elif [[ "$model" == "llama-2-70b-chat.ggmlv3.q4_0.bin" ]]; then
urls=("https://huggingface.co/TheBloke/Llama-2-70B-Chat-GGML/resolve/main/llama-2-70b-chat.ggmlv3.q4_0.bin" "https://gist.githubusercontent.com/hajowieland/04daab9f6af1435ea0a586c85f64f0bc/raw/4ab935948dd2611a3dde9d0c980dabd5373361c0/lama2-70b-chat.yaml" "https://gist.githubusercontent.com/hajowieland/f8093f4583652f7ddb685c7c7f7b03e9/raw/ed6ada13b21dd0c808152634a89f10d0f8f7f67e/llama2-chat-message.tmpl")
else
echo "Invalid version: $model. Skipping."
continue
fi
# Download each URL
for url in "${urls[@]}"; do
echo "Downloading from $url..."
wget "$url"
done
done
echo "Downloads completed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment