openMind Hub Client
简介
openMind Hub Client可以帮助您在不离开开发环境的情况下与社区进行交互。您可以轻松创建和管理仓库,下载和上传文件以及从模型库获取有用的模型和数据集元数据。
安装
关于openMind Hub Client的安装步骤,推荐用户参考《安装》文档,以确保顺利并正确地完成安装过程。
下载文件
例如,下载t5_small模型配置文件:
from openmind_hub import om_hub_download
om_hub_download(repo_id="PyTorch-NPU/t5_small", filename="config.json")
详见《下载指南》。
访问令牌
访问私有仓库资源、创建仓库和上传文件等场景都需要使用访问令牌(即token)才能与社区进行交互。请创建访问令牌并妥善保存,令牌内容仅会在创建时显示。
上传文件
使用upload_folder为您的仓库上传文件,示例如下:
from openmind_hub import upload_folder
upload_folder(
repo_id="owner/repo",
folder_path="./folder_to_upload",
token="xxx",
)
token:对目标仓库具有可写权限的访问令牌,必选。repo_id:文件要上传到的仓库,必选。folder_path:要上传目录的绝对路径或相对路径,上传的内容不包含该目录本身,必选。支持字符串或Path类型,如:"./folder"或Path("./folder")。
详见《上传文件》。
贡献
-
在提交PR之前,请确保所有测试都通过。首先在本地运行如下命令。
# The scripts below run on system default python version by default. If you want to use other python version, set the env # PY_VERSION. For example, `PY_VERSION=3.10 ./ci/lint.sh` # Lint check ./ci/lint.sh # Unit test ./ci/unit_test.sh # Functional test, Please generate the HUB_TOKEN by yourself and use it privatelly. HUB_TOKEN=your_hub_token ./ci/functional_test.sh
-
当您推送或更新PR(Pull Request)后,系统将自动触发CI(持续集成)构建和测试流程。若所有CI构建和测试均顺利通过,
ci-success标记将自动添加到您的PR中。然而,若出现CI故障,您可以点击CI日志链接以详细查看失败原因,并在本地进行必要的修复。一旦您完成了修复并希望重新运行CI作业,只需在PR中留下评论/recheck即可。
安全声明
为保障使用过程安全,推荐用户参考《安全声明》了解相关安全信息,进行必要的安全加固。
Metadata
Release files for openmind-hub 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openmind_hub-1.3.0.tar.gz | 99.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openmind_hub-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 225.4 kB
Release files / openmind_hub-1.3.0.tar.gz
| Download URL | openmind_hub-1.3.0.tar.gz |
|---|---|
| Size | 99.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2c35f0c8af17fd51a6c1777452b0ad4cbf0a50b53c67a3c4ad636e552fe204b
|
|
BLAKE2b-256 checksum How to use checksums |
28b187c04f4af620b6f438f09f3c5540a80beda5cac168aec5ba40735438d55c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.16
|
Release files / openmind_hub-1.3.0-py3-none-any.whl
| Download URL | openmind_hub-1.3.0-py3-none-any.whl |
|---|---|
| Size | 125.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae26a521ebe0951296e1440b5142372efd22c4cfe0583357e88d95aebbfea33d
|
|
BLAKE2b-256 checksum How to use checksums |
c8652b0f2b83e05eaf6621ee98611f78265e49c71e85de4e8014c4e24fec3791
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.16
|