Files
AIRegulation-DocAnalysis/download_model.sh
2026-04-28 11:29:33 +08:00

44 lines
1.1 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# download_model.sh - 下载BGE-M3模型文件可在本地Windows运行后上传到服务器
MODEL_DIR="bge-m3-model"
MODEL_URL="https://modelscope.cn/models/Xorbits/bge-m3/resolve/master"
echo "========================================"
echo "下载 BGE-M3 模型文件"
echo "========================================"
echo ""
echo "目标目录: $MODEL_DIR"
echo ""
# 创建目录
mkdir -p "$MODEL_DIR"
# 下载模型文件
FILES=(
"config.json"
"model.safetensors"
"tokenizer.json"
"tokenizer_config.json"
"special_tokens_map.json"
"vocab.txt"
"sentencepiece.bpe.model"
)
for file in "${FILES[@]}"; do
echo "下载: $file"
wget -c "$MODEL_URL/$file" -O "$MODEL_DIR/$file" || curl -L "$MODEL_URL/$file" -o "$MODEL_DIR/$file"
done
echo ""
echo "========================================"
echo "下载完成!"
echo "========================================"
echo ""
echo "模型文件列表:"
ls -lh "$MODEL_DIR"
echo ""
echo "下一步:"
echo "1. 将 $MODEL_DIR 目录上传到服务器"
echo "2. 在服务器上放置到: ~/.cache/huggingface/hub/models--BAAI--bge-m3/snapshots/main/"
echo ""