huggingface_tool
Tools for loading, upload, managing huggingface models and datasets
Installation
pip install huggingface-tool
Usage
Firstly, you need to login with huggingface-cli login (you can create or find your token at settings).
- Download and save a repo with:
htool save-repo <repo_id> <save_dir> -r <model/dataset>.-rmeans the repo is a model or dataset repo. By default, it is a model repo.- For example:
htool save-repo OpenRL/tizero ./tizero - For example:
htool save-repo OpenRL/DeepFakeFace ./DeepFakeFace -r dataset
- For example:
- Download and save a file with:
htool save-file <repo_id>:<remote_filepath> <save_dir> -r <model/dataset>.-rmeans the repo is a model or dataset repo. By default, it is a model repo.- For example:
htool save-file OpenRL/tizero:actor.pt ./tizero - For example:
htool save-file OpenRL/DeepFakeFace:README.md ./DeepFakeFace -r dataset
- For example:
- Download and save transformer models with:
htool save-model <model_class> <model_name> <save_dir>- For example:
htool save-model AutoModelForCausalLM gpt2 ./gpt2
- For example:
- Download and save tokenizer with:
htool save-tk <tokenizer_name> <save_dir>- For example:
htool save-tk gpt2 ./gpt2
- For example:
- Download and save dataset with:
htool save-data <dataset_name> <save_dir>- For example:
htool save-data daily_dialog ./daily_dialog
- For example:
- Download and save diffusion models with:
htool save-dm <model_name> <save_dir>- For example:
htool save-dm google/ddpm-cat-256 ./google/
- For example:
You can also use htool to upload datasets and models to huggingface.
- Upload a file with:
htool upload-file <local_filepath> <organization_or_username/repo_name>:<remote_filepath> -r <model/dataset>.-rmeans the repo is a model or dataset repo. By default, it is a model repo.- For example:
htool upload-file README.md OpenRL/tizero:README.md - For example:
htool upload-file README.md OpenRL/DeepFakeFace:README.md -r dataset
- For example:
- Upload a directory with:
htool upload-dir <local_dirpath> <organization_or_username/repo_name>:<remote_dirpath> -r <model/dataset>.-rmeans the repo is a model or dataset repo. By default, it is a model repo.- For example:
htool upload-dir ./tizero OpenRL/tizero:./ - For example:
htool upload-dir ./tizero/models OpenRL/tizero:./models - For example:
htool upload-dir ./DeepFakeFace OpenRL/DeepFakeFace:./ -r dataset - For example:
htool upload-dir ./DeepFakeFace/images OpenRL/DeepFakeFace:./images -r dataset
- For example:
- Upload dataset with:
htool upload-data <local_dataset_dir> <organization_or_username/dataset_name>- For example:
htool upload-data ./daily_dialog OpenRL/daily_dialog
- For example:
- Upload model with:
htool upload-model <local_model_dir> <organization_or_username/model_name>- For example:
htool upload-model ./tizero OpenRL/tizero
- For example:
Citing huggingface_tool
If our work has been helpful to you, please feel free to cite us:
@misc{huggingface_tool2023,
title={huggingface_tool},
author={OpenRL Contributors},
publisher = {GitHub},
howpublished = {\url{https://github.com/OpenRL-Lab/huggingface_tool}},
year={2023},
}
Metadata
Release files for huggingface-tool 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| huggingface_tool-0.0.6.tar.gz | 13.8 kB | Without provenance | Details for huggingface_tool-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| huggingface_tool-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for huggingface_tool-0.0.6-py3-none-any.whl |
Total release size: 41.5 kB
Release files / huggingface_tool-0.0.6.tar.gz
| Download URL | huggingface_tool-0.0.6.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe61ef61e52c8310fe3e993856f177ee2a7ff67ab7d93672b131bab3bbea8d89
|
|
BLAKE2b-256 checksum How to use checksums |
e773126a11ca77c51f9d811c3f767afe277c1b8885f03f0c8e75fc485a790cf2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / huggingface_tool-0.0.6-py3-none-any.whl
| Download URL | huggingface_tool-0.0.6-py3-none-any.whl |
|---|---|
| Size | 27.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b55ed1c54ec68378e007d673d1956a815ce1a963e56102dd17f1996b87d1324a
|
|
BLAKE2b-256 checksum How to use checksums |
a4758883b242d25dca7dbd62539fb34df915f4694518ce3f12b2f1822938fc87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Security for huggingface-tool 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.