A tool to transfer models/datasets from Hugging Face to ModelScope
Project description
Hugging Face to ModelScope Transfer
A tool to transfer models/datasets from the Hugging Face Hub to the ModelScope platform.
By default, when transferring a repository from Hugging Face (e.g., user/package), it will be created on ModelScope as package. If a repository with the same name already exists, a timestamp will be appended to the name (e.g., package_20250708160640). You can also specify a custom name using the --ms-repo-name argument. Note: You cannot provide a custom ModelScope repository name when transferring multiple Hugging Face repositories.
By default, the dataset_infos.json file is not uploaded to ModelScope for datasets, as it can sometimes cause issues on the platform. You can choose to keep this file by using the --keep-dataset-infos flag.
Installation
pip install hf-ms-transfer
Usage
Create a .env file in the directory where you will run the command and add your ModelScope token and username:
ms_token="your_modelscope_token"
ms_name="your_modelscope_username"
# Optional: Specify a Hugging Face Hub endpoint
# HF_ENDPOINT="https://huggingface.co"
Alternatively, you can provide these directly via command-line arguments.
hf-ms-transfer <hf_repo_ids> [--private] [--ms-token <token>] [--ms-name <username>] [--ms-repo-name <name>] [--keep-dataset-infos]
All parameters:
<hf_repo_ids>: The Hugging Face model or dataset IDs, separated by commas (e.g.,'bert-base-uncased,stanfordnlp/imdb').--private: (Optional) Make the ModelScope repository private (default is public).--ms-token <token>: (Optional) Your ModelScope access token. Overrides the value in.env. If not provided, aValueErrorwill be raised.--ms-name <username>: (Optional) Your ModelScope username. Overrides the value in.env. If not provided, aValueErrorwill be raised.--ms-repo-name <name>: (Optional) The desired repository name on ModelScope. If not provided, the Hugging Face repository name (without the username) will be used.--keep-dataset-infos: (Optional) Keep thedataset_infos.jsonfile for datasets.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hf_ms_transfer-0.4.0.tar.gz.
File metadata
- Download URL: hf_ms_transfer-0.4.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5964c8886b0f759d1c995228b5eb826b2d676815c21dcf722895711b25defdcc
|
|
| MD5 |
9f4a5342ed912aae78bf9b38edfda090
|
|
| BLAKE2b-256 |
84474cd642d3bbd7b8e81201f341ac81dd01b9a68cbc1f714a8ff16fa427ddf4
|
File details
Details for the file hf_ms_transfer-0.4.0-py3-none-any.whl.
File metadata
- Download URL: hf_ms_transfer-0.4.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00ab6f3798f345eccaf89e4552a3a983aa3150352f93c2051fa12d432901a87d
|
|
| MD5 |
587e11ed1ae2b906c55c6539d8187d7b
|
|
| BLAKE2b-256 |
6ff48cdc8b75151afea479aa407da83c739e3e2e70d77e1f22d35cbba8d0bdf2
|