Skip to main content

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")

详见《上传文件》

贡献

  1. 在提交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
    
  2. 当您推送或更新PR(Pull Request)后,系统将自动触发CI(持续集成)构建和测试流程。若所有CI构建和测试均顺利通过,ci-success标记将自动添加到您的PR中。然而,若出现CI故障,您可以点击CI日志链接以详细查看失败原因,并在本地进行必要的修复。一旦您完成了修复并希望重新运行CI作业,只需在PR中留下评论/recheck即可。

安全声明

为保障使用过程安全,推荐用户参考《安全声明》了解相关安全信息,进行必要的安全加固。

Download files

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

Source Distribution

openmind_hub-1.3.0.tar.gz (99.9 kB view details)

Uploaded Source

Built Distribution

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

openmind_hub-1.3.0-py3-none-any.whl (125.5 kB view details)

Uploaded Python 3

File details

Details for the file openmind_hub-1.3.0.tar.gz.

File metadata

  • Download URL: openmind_hub-1.3.0.tar.gz
  • Upload date:
  • Size: 99.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for openmind_hub-1.3.0.tar.gz
Algorithm Hash digest
SHA256 b2c35f0c8af17fd51a6c1777452b0ad4cbf0a50b53c67a3c4ad636e552fe204b
MD5 2e8a50775f00ab6e6ee267a47dde7ed1
BLAKE2b-256 28b187c04f4af620b6f438f09f3c5540a80beda5cac168aec5ba40735438d55c

See more details on using hashes here.

File details

Details for the file openmind_hub-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: openmind_hub-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 125.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for openmind_hub-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae26a521ebe0951296e1440b5142372efd22c4cfe0583357e88d95aebbfea33d
MD5 54e65f26878f02b27974503ac13117ee
BLAKE2b-256 c8652b0f2b83e05eaf6621ee98611f78265e49c71e85de4e8014c4e24fec3791

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 files

1.2.0

2 files

1.1.0

2 files

0.9.1

1 file

0.9.0

1 file

0.8.0

1 file

0.7.1

2 files

0.7.0

1 file

Supported by

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