]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
examples : redirect download scripts to HF
authorGeorgi Gerganov <redacted>
Mon, 12 Dec 2022 21:49:12 +0000 (23:49 +0200)
committerGeorgi Gerganov <redacted>
Mon, 12 Dec 2022 21:49:12 +0000 (23:49 +0200)
.gitignore
examples/gpt-2/download-ggml-model.sh
examples/gpt-j/download-ggml-model.sh

index 58cfed04f5032a7638a5deef2e334a1992e8ee46..9e331d7ce2715fed6ba49df25dc0c75fa781e08b 100644 (file)
@@ -6,5 +6,6 @@ compile_commands.json
 
 .exrc
 .cache
+.DS_Store
 
 src/arm_neon.h
index 9708618632de79fe4f3451b3882873da6f50a4e4..8856bef75c37a2a70d0d146979590db9ea9ca340 100755 (executable)
@@ -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
@@ -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"
index f6f579175f8bd3506cae8e6dc9d2c600576b93ed..76b0a30fd03c9bcf4169fcf8b7f3c1fec7d15350 100755 (executable)
@@ -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
@@ -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"