HuggingFace Model Download 是一个用于从 HuggingFace 下载模型时给出正确命令语法的技能。当用户需要“download model”“hf download”或涉及“huggingface”下载操作时,可借助它获得规范的命令写法。
用途 该技能面向从 HuggingFace Hub 获取模型文件的场景,帮助使用者避免常见的命令错误,确保下载命令能够正确执行。
主要能力 技能给出的核心命令模式是:始终使用 uv run,并将 HuggingFace Hub 包作为内联依赖:
uv run --with huggingface_hub hf download <repo> <file> --local-dir <path>
资料还列出常见错误,用于规避:
- 错误:pip install huggingface_hub && huggingface-cli download ...
- 错误:uv run hf download ...(缺少 --with)
- 错误:uv run --with "huggingface_hub[cli]" ...([cli] extra 并不存在,CLI 已包含在基础包中)
使用方式(语法参考)
- 下载指定文件:uv run --with huggingface_hub hf download <org>/<repo> <filename> --local-dir <destination>
- 下载多个文件:uv run --with huggingface_hub hf download <org>/<repo> <file1> <file2> --local-dir <destination>
- 使用 glob 模式下载:uv run --with huggingface_hub hf download <org>/<repo> --include "*.gguf" --local-dir <destination>
- 下载整个仓库:uv run --with huggingface_hub hf download <org>/<repo> --local-dir <destination>
注意事项 资料提醒:大型 GGUF 模型常被拆分为多个部分(例如 model.gguf.part-000、.part-001 等)。应使用 --include ".gguf"(注意末尾的星号)以同时匹配单个 GGUF 文件和分片部分;建议先用 --dry-run 检查将要下载哪些文件。对于 GGUF 模型,只下载所需的量化版本,而不是整个仓库。
其它说明 HF_TOKEN 环境变量会被自动用于受限(gated)模型。--local-dir 会把文件直接放入目标目录,不产生嵌套的 .cache 结构。下载可续传,重新运行同一命令会跳过已下载的文件。
适用场景与限制 该技能适用于需要用规范命令从 HuggingFace 下载模型文件的用户,尤其是涉及 GGUF 模型、多文件或整仓库下载时。资料未提供具体的收费、价格、平台支持范围或效果说明,这些内容暂未提供。