File size: 700 Bytes
3d27cfe | 1 2 3 4 5 6 7 8 9 10 11 | from huggingface_hub import snapshot_download
# 下载 Hugging Face 模型(核心:repo_type="model")
local_dir = snapshot_download(
repo_id="bingqin111/mistral_data3_2w_sft", # 模型仓库 ID(替换为你需要的模型)
repo_type="model",
local_dir="/root/test/weitiao/CharacterEval/model", # 先设置好文件夹
# 可选参数(根据需求添加)
# ignore_patterns=["*.bin.index.json", "*.msgpack"], # 忽略不需要的文件(如索引文件)
resume_download=True, # 支持断点续传(网络中断后重新运行可继续下载)
# token="your_hf_token" # 若模型是私有/ gated 模型,需传入你的 Hugging Face Token
) |