npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

huggingface-downloader

v1.0.11

Published

一个用于从 Hugging Face 下载模型和数据集文件的命令行工具,支持多线程下载和进度显示。

Downloads

43

Readme

Hugging Face Downloader

一个用于从 Hugging Face 下载模型和数据集文件的命令行工具,支持多线程下载和进度显示。

功能特性

  • 多线程并发下载,提高下载速度
  • 实时显示下载进度、速度和剩余时间
  • 支持 Hugging Face 镜像源
  • 支持私有模型和数据集下载(需要访问令牌)
  • 友好的命令行界面和错误提示

安装

使用 npm 安装:

npm install -g huggingface-downloader

或者使用 pnpm:

pnpm install -g huggingface-downloader

使用方法

基本用法:

hf-download --type <model|dataset> --repository <namespace/repositoryName> [options]

参数说明

| 参数 | 说明 | 必填 | 默认值 | |------|------|------|--------| | -r, --repository <string> | 仓库名称,格式为 namespace/repositoryName | 是 | 无 | | --type <model\|dataset> | 库类型,model 或者 dataset | 是 | 无 | | -o, --output <path> | 下载路径 | 否 | 当前目录 | | -t, --threads <number> | 线程数,不会超过 CPU 核心数 | 否 | 4 | | --token <token> | Hugging Face 的访问令牌,用于访问私有仓库 | 否 | 无 | | -m, --mirror <url> | Hugging Face 镜像源地址 | 否 | 无 |

环境变量

| 变量名 | 说明 | |--------|------| | HF_ACCESS_TOKEN | Hugging Face 访问令牌,替代 --token 参数 | | HF_MIRROR | Hugging Face 镜像源地址,替代 -m, --mirror 参数 |

示例

  1. 下载公开模型到当前目录:
hf-download --type model --repository google-bert/bert-base-uncased
  1. 下载公开数据集到指定目录:
hf-download --type dataset --repository glue --output ./datasets
  1. 使用镜像源下载:
hf-download --type model --repository google-bert/bert-base-uncased --mirror https://hf-mirror.com

或者设置环境变量:

export HF_MIRROR=https://hf-mirror.com
hf-download --type model --repository google-bert/bert-base-uncased
  1. 下载私有模型:
hf-download --type model --repository username/private-model --token your_access_token

或者设置环境变量:

export HF_ACCESS_TOKEN=your_access_token
hf-download --type model --repository username/private-model
  1. 调整线程数:
hf-download --type model --repository google-bert/bert-base-uncased --threads 8

显示效果

程序运行时会显示类似以下的界面:

1. model.bin         45.2%   2.34 MB/s   剩余时间:00:02:15
2. config.json       下载完成
3. tokenizer.json    12.8%   1.05 MB/s   剩余时间:00:08:42
...

许可证

ISC