瀏覽代碼

feat(workflow): add GGUF metadata support to model conversion workflow

沉默の金 5 月之前
父節點
當前提交
ac306c0bd8
共有 1 個文件被更改,包括 16 次插入5 次删除
  1. 16 5
      .github/workflows/convert-model.yml

+ 16 - 5
.github/workflows/convert-model.yml

@@ -25,6 +25,14 @@ on:
         required: false
         type: string
         default: 'fp32,fp16,q8_0,q4_0,q4_1,q5_0,q5_1'
+      gguf_name:
+        description: 'GGUF 元数据中的模型名称 (可选, 默认: Mel-Band-Roformer Separator)'
+        required: false
+        type: string
+      gguf_description:
+        description: 'GGUF 元数据中的模型描述 (可选, 默认: Music source separation model)'
+        required: false
+        type: string
 
 env:
   SUPPORTED_QUANT_TYPES: 'fp32,fp16,q8_0,q4_0,q4_1,q5_0,q5_1'
@@ -98,6 +106,8 @@ jobs:
           CHECKPOINT="model/${{ inputs.checkpoint_path }}"
           CONFIG="model/${{ inputs.config_path }}"
           MODEL_NAME="${{ inputs.model_name }}"
+          GGUF_NAME="${{ inputs.gguf_name }}"
+          GGUF_DESC="${{ inputs.gguf_description }}"
           QUANT_TYPES="${{ inputs.quantization_types }}"
           
           # If no types specified, use all supported types
@@ -124,11 +134,12 @@ jobs:
             
             echo ">>> Converting to $qtype -> $OUTPUT_FILE"
             
-            python scripts/convert_to_gguf.py \
-              --ckpt "$CHECKPOINT" \
-              --config "$CONFIG" \
-              --out "$OUTPUT_FILE" \
-              --dtype "$qtype"
+            # Build convert command with optional metadata args
+            CMD="python scripts/convert_to_gguf.py --ckpt \"$CHECKPOINT\" --config \"$CONFIG\" --out \"$OUTPUT_FILE\" --dtype \"$qtype\""
+            [ -n "$GGUF_NAME" ] && CMD="$CMD --name \"$GGUF_NAME\""
+            [ -n "$GGUF_DESC" ] && CMD="$CMD --description \"$GGUF_DESC\""
+            
+            eval $CMD
               
             # Show file size
             SIZE=$(ls -lh "$OUTPUT_FILE" | awk '{print $5}')