SimpleTool / llama_cpp.sh
Cialtion's picture
Upload llama_cpp.sh with huggingface_hub
1d527f8 verified
raw
history blame
1.13 kB
#!/bin/bash
# 定义路径
LLAMA_CPP_DIR="/inspire/hdd/global_user/shixiaoxin-253107030017/sxx/llama.cpp"
WORK_DIR=$(pwd)
OUTPUT_DIR="${WORK_DIR}/gguf_models"
# 创建输出目录
mkdir -p "$OUTPUT_DIR"
# 要转换的模型列表
models=(
"sft_qwen25_05b"
"sft_qwen25_14b"
"sft_qwen25_15b"
"sft_qwen25_3b"
"sft_qwen25_7b"
"sft_qwen3_30b"
"sft_qwen3_4b"
)
# 批量转换
for model in "${models[@]}"; do
echo "=========================================="
echo "Converting: $model"
echo "=========================================="
input_path="${WORK_DIR}/${model}"
output_file="${OUTPUT_DIR}/${model}.gguf"
if [ -d "$input_path" ]; then
python "${LLAMA_CPP_DIR}/convert_hf_to_gguf.py" \
"$input_path" \
--outfile "$output_file" \
--outtype f16
if [ $? -eq 0 ]; then
echo "✓ Success: $output_file"
else
echo "✗ Failed: $model"
fi
else
echo "✗ Directory not found: $input_path"
fi
echo ""
done
echo "Done! Output directory: $OUTPUT_DIR"