Skip to main content

A tool to transfer models/datasets from Hugging Face to ModelScope

Project description

Hugging Face to ModelScope Transfer

简体中文

A simple command-line tool to transfer models and datasets from the Hugging Face Hub to the ModelScope Hub.

Features

  • Supports both models and datasets.
  • Transfer multiple repositories in a single command.
  • Option to specify a custom repository name on ModelScope.
  • Automatic repository naming with collision handling (appends a timestamp if the name exists).
  • Configure credentials using a .env file or command-line arguments.
  • Transfer into public or private repositories.

Installation

pip install hf-ms-transfer

Usage

1. Configuration

Create a .env file in your project directory and add your ModelScope token and username. You can get your token from the ModelScope user center.

# .env
ms_token="your_modelscope_token"
ms_name="your_modelscope_username"

Alternatively, you can provide the token and username directly as command-line arguments.

2. Run the Command

hf-ms-transfer <hf_repo_ids> [options]

Arguments

  • <hf_repo_ids>: (Required) One or more Hugging Face repository IDs, separated by commas (e.g., bert-base-uncased,stanfordnlp/imdb).
  • --ms-token <token>: (Optional) Your ModelScope access token. Overrides the value in the .env file.
  • --ms-name <username>: (Optional) Your ModelScope username. Overrides the value in the .env file.
  • --ms-repo-name <name>: (Optional) A custom name for the repository on ModelScope.

    Note: This option cannot be used when transferring multiple repositories.

  • --private: (Optional) Create the ModelScope repository as private. Defaults to public.
  • --keep-dataset-infos: (Optional) For datasets, upload the dataset_infos.json file. By default, this file is excluded as it can cause issues when using load_datastes function.

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

hf_ms_transfer-0.4.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

hf_ms_transfer-0.4.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file hf_ms_transfer-0.4.1.tar.gz.

File metadata

  • Download URL: hf_ms_transfer-0.4.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for hf_ms_transfer-0.4.1.tar.gz
Algorithm Hash digest
SHA256 8ee4f9fd7857a311e33fc6d2bae4806a57ef50715cc0fb6cca8db755495d6bd2
MD5 088418513f14f5be56837d6f8fe6950b
BLAKE2b-256 18359566c8acbe16830b9bcee92dfb3d4d9148fff01eeaa55ce3be49e0dad0c8

See more details on using hashes here.

File details

Details for the file hf_ms_transfer-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: hf_ms_transfer-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for hf_ms_transfer-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf15eb0926856b7e5b2388de153941d6c9e95ffd9ebc0eedcf390fe7e4dd5361
MD5 028f38faf96de204096a2a8efaafcdbb
BLAKE2b-256 3367bba889b9495875cbbd494ddabb363395f19e942ef578d554d4cc0fff372c

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