download_huggingface_model
Download Hugging Face models locally with options to specify files, branches, and filters. Supports concurrent downloads, resume, and retries for efficient transfers.
Instructions
⚡ 高速下载 HuggingFace 模型到本地 - 支持并发下载、断点续传、智能重试,比传统方式快3-5倍。可指定文件、分支、筛选模式等高级选项。
Input Schema
Name | Required | Description | Default |
---|---|---|---|
allow_patterns | No | 允许下载的文件模式(glob 语法),支持单个或多个模式 | |
download_dir | No | 下载保存目录(支持相对/绝对路径),默认:~/Downloads/huggingface_models | |
files | No | 指定下载的具体文件列表(精确匹配文件路径) | |
force_redownload | No | 强制重新下载(忽略本地缓存) | |
ignore_patterns | No | 忽略的文件模式(glob 语法),支持单个或多个模式 | |
repo_id | Yes | HuggingFace 仓库 ID,格式:用户名/模型名 | |
revision | No | Git 分支、标签或 commit hash,默认:main | main |
Input Schema (JSON Schema)
{
"properties": {
"allow_patterns": {
"description": "允许下载的文件模式(glob 语法),支持单个或多个模式",
"examples": [
"*.json",
[
"*.safetensors",
"*.bin"
],
"**/model-*.safetensors"
],
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"download_dir": {
"description": "下载保存目录(支持相对/绝对路径),默认:~/Downloads/huggingface_models",
"type": "string"
},
"files": {
"description": "指定下载的具体文件列表(精确匹配文件路径)",
"examples": [
[
"config.json",
"model.safetensors"
]
],
"items": {
"type": "string"
},
"type": "array"
},
"force_redownload": {
"default": false,
"description": "强制重新下载(忽略本地缓存)",
"type": "boolean"
},
"ignore_patterns": {
"description": "忽略的文件模式(glob 语法),支持单个或多个模式",
"examples": [
"*.h5",
[
"*.msgpack",
"*.ckpt"
],
"vocab.json"
],
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"repo_id": {
"description": "HuggingFace 仓库 ID,格式:用户名/模型名",
"examples": [
"2Noise/ChatTTS",
"microsoft/DialoGPT-medium",
"openai/whisper-large-v3",
"meta-llama/Meta-Llama-3.1-8B"
],
"type": "string"
},
"revision": {
"default": "main",
"description": "Git 分支、标签或 commit hash,默认:main",
"type": "string"
}
},
"required": [
"repo_id"
],
"type": "object"
}