interplane.Get Omega
Read in your language

ggml

[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)

Brought by drakestapleton

branch master Branches Tags History

ggml / examples / gpt-2 / download-model.sh

48 lines · 1117 bytes Raw Blame History
1#!/bin/bash
2
3ggml_path=$(dirname $(realpath $0))
4
5# GPT-2 models
6models=( "117M" "345M" "774M" "1558M" )
7
8# list available models
9function 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
18if [ "$#" -ne 1 ]; then
19 printf "Usage: $0 <model>\n"
20 list_models
21
22 exit 1
23fi
24
25model=$1
26
27if [[ ! " ${models[@]} " =~ " ${model} " ]]; then
28 printf "Invalid model: $model\n"
29 list_models
30
31 exit 1
32fi
33
34# download model
35
36printf "Downloading model $model ...\n"
37
38mkdir -p models/gpt-2-$model
39
40for 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
42done
43
44printf "Done! Model '$model' saved in 'models/gpt-2-$model/'\n\n"
45printf "Run the convert-ckpt-to-ggml.py script to convert the model to ggml format.\n"
46printf "\n"
47printf " python $ggml_path/convert-ckpt-to-ggml.py models/gpt-2-$model/\n"
48printf "\n"