Skip to content

Commit

Permalink
examples : redirect download scripts to HF
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Dec 12, 2022
1 parent ed09c71 commit 64efece
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ compile_commands.json

.exrc
.cache
.DS_Store

src/arm_neon.h
15 changes: 14 additions & 1 deletion examples/gpt-2/download-ggml-model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
#
# If you want to download the original GPT-2 model files, use the "download-model.sh" script instead.

#src="https://ggml.ggerganov.com"
#pfx="ggml-model-gpt-2"

src="https://huggingface.co/datasets/ggerganov/ggml"
pfx="resolve/main/ggml-model-gpt-2"

ggml_path=$(dirname $(realpath $0))

# GPT-2 models
Expand Down Expand Up @@ -42,7 +48,14 @@ printf "Downloading ggml model $model ...\n"

mkdir -p models/gpt-2-$model

wget --quiet --show-progress -O models/gpt-2-$model/ggml-model.bin https://ggml.ggerganov.com/ggml-model-gpt-2-$model.bin
if [ -x "$(command -v wget)" ]; then
wget --quiet --show-progress -O models/gpt-2-$model/ggml-model.bin $src/$pfx-$model.bin
elif [ -x "$(command -v curl)" ]; then
curl -L --output models/gpt-2-$model/ggml-model.bin $src/$pfx-$model.bin
else
printf "Either wget or curl is required to download models.\n"
exit 1
fi

if [ $? -ne 0 ]; then
printf "Failed to download ggml model $model \n"
Expand Down
15 changes: 14 additions & 1 deletion examples/gpt-j/download-ggml-model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
#
# If you want to download the original GPT-J model files, use the "download-model.sh" script instead.

#src="https://ggml.ggerganov.com"
#pfx="ggml-model-gpt-j"

src="https://huggingface.co/datasets/ggerganov/ggml"
pfx="resolve/main/ggml-model-gpt-j"

ggml_path=$(dirname $(realpath $0))

# GPT-J models
Expand Down Expand Up @@ -42,7 +48,14 @@ printf "Downloading ggml model $model ...\n"

mkdir -p models/gpt-j-$model

wget --quiet --show-progress -O models/gpt-j-$model/ggml-model.bin https://ggml.ggerganov.com/ggml-model-gpt-j-$model.bin
if [ -x "$(command -v wget)" ]; then
wget --quiet --show-progress -O models/gpt-j-$model/ggml-model.bin $src/$pfx-$model.bin
elif [ -x "$(command -v curl)" ]; then
curl -L --output models/gpt-j-$model/ggml-model.bin $src/$pfx-$model.bin
else
printf "Either wget or curl is required to download models.\n"
exit 1
fi

if [ $? -ne 0 ]; then
printf "Failed to download ggml model $model \n"
Expand Down

0 comments on commit 64efece

Please sign in to comment.