Skip to content

Commit

Permalink
fix model converter script (TabbyML#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys authored Oct 27, 2023
1 parent 38402ce commit 89d1765
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions experimental/model-converter/update-llama-model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,40 @@ prepare_llama_cpp() {
}

update_model() {
MODEL_ID=$1
CONVERTER=$1
MODEL_ID=$2

git clone https://${ACCESS_TOKEN}@huggingface.co/$MODEL_ID hf_model --depth 1
git clone https://huggingface.co/$MODEL_ID hf_model --depth 1

pushd hf_model
huggingface-cli lfs-enable-largefiles .

python ../llama.cpp/convert-starcoder-hf-to-gguf.py . --outfile ./ggml/f16.v2.gguf 1
"$CONVERTER"
../llama.cpp/build/bin/quantize ./ggml/f16.v2.gguf ./ggml/q8_0.v2.gguf q8_0

git add .
git commit -m "add ggml model v2"
git lfs push origin
git push origin
huggingface-cli upload $MODEL_ID ggml/q8_0.v2.gguf ggml/q8_0.v2.gguf
popd

echo "Success!"
rm -rf hf_model
}

starcoder() {
python ../llama.cpp/convert-starcoder-hf-to-gguf.py . --outfile ./ggml/f16.v2.gguf 1
}

llama() {
python ../llama.cpp/convert.py . --outfile ./ggml/f16.v2.gguf --outtype f16
}

set -x
huggingface-cli login --token ${ACCESS_TOKEN}

prepare_llama_cpp || true

# update_model TabbyML/StarCoder-1B
# update_model TabbyML/StarCoder-3B
update_model TabbyML/StarCoder-7B
update_model TabbyML/CodeLlama-7B
update_model TabbyML/CodeLlama-13B
update_model TabbyML/Mistral-7B
update_model TabbyML/WizardCoder-3B
update_model starcoder TabbyML/StarCoder-1B
update_model starcoder TabbyML/StarCoder-3B
update_model starcoder TabbyML/StarCoder-7B
update_model llama TabbyML/CodeLlama-7B
update_model llama TabbyML/CodeLlama-13B
update_model llama TabbyML/Mistral-7B
update_model starcoder TabbyML/WizardCoder-3B

0 comments on commit 89d1765

Please sign in to comment.