Skip to content

Commit 8a18259

Browse files
committed
fix(ci): snap 构建前下载 embedder 模型,修复 go:embed runtime/data 缺失
1 parent 64634a2 commit 8a18259

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,19 @@ jobs:
766766
- name: Checkout
767767
uses: actions/checkout@v4
768768

769+
# embed.go embeds runtime/data, so the model file must be present in the
770+
# clean checkout before `go build` (same step as the build job).
771+
- name: Download embedder model
772+
run: |
773+
MODEL_PATH="runtime/data/models/model.onnx"
774+
mkdir -p "$(dirname "$MODEL_PATH")"
775+
rm -f "$MODEL_PATH"
776+
echo "Downloading embedder model from HuggingFace..."
777+
curl -fL -o "$MODEL_PATH" \
778+
"https://huggingface.co/Xenova/bge-small-zh-v1.5/resolve/main/onnx/model.onnx" || \
779+
{ echo "ERROR: Failed to download embedder model"; exit 1; }
780+
echo "Model file size: $(wc -c < "$MODEL_PATH") bytes"
781+
769782
- name: Generate snapcraft.yaml from template
770783
run: |
771784
sed -e "s|__VERSION__|${{ needs.prepare.outputs.version_num }}|g" \

0 commit comments

Comments
 (0)