Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/examples/gpt-2/download-model.sh # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / examples / gpt-2 / download-model.sh` 48 lines ยท 1117 bytes Raw Blame History 1 #!/bin/bash 2 3 ggml_path=$(dirname $(realpath $0)) 4 5 # GPT-2 models 6 models=( "117M" "345M" "774M" "1558M" ) 7 8 # list available models 9 function list_models { 10 printf "\n" 11 printf " Available models:" 12 for model in "${models[@]}"; do 13 printf " $model" 14 done 15 printf "\n\n" 16 } 17 18 if [ "$#" -ne 1 ]; then 19 printf "Usage: $0 \n" 20 list_models 21 22 exit 1 23 fi 24 25 model=$1 26 27 if [[ ! " ${models[@]} " =~ " ${model} " ]]; then 28 printf "Invalid model: $model\n" 29 list_models 30 31 exit 1 32 fi 33 34 # download model 35 36 printf "Downloading model $model ...\n" 37 38 mkdir -p models/gpt-2-$model 39 40 for file in checkpoint encoder.json hparams.json model.ckpt.data-00000-of-00001 model.ckpt.index model.ckpt.meta vocab.bpe; do 41 wget --quiet --show-progress -O models/gpt-2-$model/$file https://openaipublic.blob.core.windows.net/gpt-2/models/$model/$file 42 done 43 44 printf "Done! Model '$model' saved in 'models/gpt-2-$model/'\n\n" 45 printf "Run the convert-ckpt-to-ggml.py script to convert the model to ggml format.\n" 46 printf "\n" 47 printf " python $ggml_path/convert-ckpt-to-ggml.py models/gpt-2-$model/\n" 48 printf "\n"