Skip to main content

A command-line tool for downloading models from ModelScope and Hugging Face platforms

Project description

modelhubxc-tool

一个用于从 ModelScope 和 Hugging Face 等平台下载模型的命令行工具。

简介

modelhubxc-tool 是一个命令行工具,旨在简化从 ModelScope 和 Hugging Face 等模型平台下载模型的过程。它支持从多个平台下载模型,并提供了便捷的查询功能来获取模型信息。

功能

  • 从 ModelScope 和 Hugging Face 下载模型
  • 查询模型信息
  • 支持批量下载(通过 CSV 文件)
  • 配置文件管理
  • 可自定义下载路径和缓存目录

安装

使用 pip 安装:

pip install modelhubxc-tool

使用方法

1. 下载模型

从 ModelScope 下载模型:

modelhubxc-tool download --source modelscope owner/model-name

从 Hugging Face 下载模型:

modelhubxc-tool download --source huggingface owner/model-name

2. 查询模型信息

查询模型的详细信息:

modelhubxc-tool query owner/model-name

3. 批量下载

通过 CSV 文件批量下载模型,CSV 文件格式为:

model-id,source
owner/model1,modelscope
owner/model2,huggingface

批量下载命令:

modelhubxc-tool download-by-csv path/to/your/csv/file.csv

4. 查看版本

查看工具版本:

modelhubxc-tool --version

配置

工具会在 ~/.config/modelhubxc/config.yaml 创建配置文件,包含以下可配置项:

  • download_dir: 下载目录路径
  • cache_dir: 缓存目录路径
  • max_workers: 最大并发下载线程数
  • cookie_file: Cookie 文件路径
  • token: 认证令牌

首次运行时,如果下载目录未配置,工具会提示输入下载路径。

依赖

  • typer (>=0.20.1,<0.21.0)
  • pyyaml (>=6.0.3,<7.0.0)
  • requests (>=2.31.0,<3.0.0)
  • rich (>=13.0.0,<14.0.0)
  • modelscope (>=1.33.0,<2.0.0)
  • huggingface-hub (>=1.2.3,<2.0.0)

开发

git clone <repository-url>
cd modelhubxc-tool
pip install -e .

许可证

此项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modelhubxc_tool-0.1.3.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modelhubxc_tool-0.1.3-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file modelhubxc_tool-0.1.3.tar.gz.

File metadata

  • Download URL: modelhubxc_tool-0.1.3.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/24.4.0

File hashes

Hashes for modelhubxc_tool-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4f9745dbfff47856cc48a0b2e970c668b75cc9002ef65231c7c51f40bdc1904d
MD5 12ab00f4acec81a5fda9e2c7c9e1d29b
BLAKE2b-256 2d08b3871c9fc5612c4ed2978cb086b8fbc769dfb6b9f88d07beb634189a6766

See more details on using hashes here.

File details

Details for the file modelhubxc_tool-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: modelhubxc_tool-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/24.4.0

File hashes

Hashes for modelhubxc_tool-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 04ff0285c636ba5d915b753e559004360afa275dde2ca1535c8165954f0d211c
MD5 3d01b5beb3d3f17ed586b80c7844df2c
BLAKE2b-256 e9a377547d64cc1919c17fad4eae5877d97b25a2260a4a2bb466d4b464bf2124

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page