Cialtion commited on
Commit
1d527f8
·
verified ·
1 Parent(s): 81f0971

Upload llama_cpp.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. llama_cpp.sh +48 -0
llama_cpp.sh ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # 定义路径
4
+ LLAMA_CPP_DIR="/inspire/hdd/global_user/shixiaoxin-253107030017/sxx/llama.cpp"
5
+ WORK_DIR=$(pwd)
6
+ OUTPUT_DIR="${WORK_DIR}/gguf_models"
7
+
8
+ # 创建输出目录
9
+ mkdir -p "$OUTPUT_DIR"
10
+
11
+ # 要转换的模型列表
12
+ models=(
13
+ "sft_qwen25_05b"
14
+ "sft_qwen25_14b"
15
+ "sft_qwen25_15b"
16
+ "sft_qwen25_3b"
17
+ "sft_qwen25_7b"
18
+ "sft_qwen3_30b"
19
+ "sft_qwen3_4b"
20
+ )
21
+
22
+ # 批量转换
23
+ for model in "${models[@]}"; do
24
+ echo "=========================================="
25
+ echo "Converting: $model"
26
+ echo "=========================================="
27
+
28
+ input_path="${WORK_DIR}/${model}"
29
+ output_file="${OUTPUT_DIR}/${model}.gguf"
30
+
31
+ if [ -d "$input_path" ]; then
32
+ python "${LLAMA_CPP_DIR}/convert_hf_to_gguf.py" \
33
+ "$input_path" \
34
+ --outfile "$output_file" \
35
+ --outtype f16
36
+
37
+ if [ $? -eq 0 ]; then
38
+ echo "✓ Success: $output_file"
39
+ else
40
+ echo "✗ Failed: $model"
41
+ fi
42
+ else
43
+ echo "✗ Directory not found: $input_path"
44
+ fi
45
+ echo ""
46
+ done
47
+
48
+ echo "Done! Output directory: $OUTPUT_DIR"