Skip to main content

Hub client SDK for openMind

Project description

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即可。

安全声明

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

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

openmind_hub_guozr-1.2.0.dev0.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_guozr-1.2.0.dev0-py3-none-any.whl (125.6 kB view details)

Uploaded Python 3

File details

Details for the file openmind_hub_guozr-1.2.0.dev0.tar.gz.

File metadata

  • Download URL: openmind_hub_guozr-1.2.0.dev0.tar.gz
  • Upload date:
  • Size: 99.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for openmind_hub_guozr-1.2.0.dev0.tar.gz
Algorithm Hash digest
SHA256 30287ff5038146b26e0b5afc8d11d3373f462b0510f371d9379eabdd8ef85406
MD5 5a2c43f5ab135fa595c3e07c9e347edb
BLAKE2b-256 3c7442332eca8502e5bf75e6ac9c78cc0911ab35ce440e771b6c84b79a53db5f

See more details on using hashes here.

File details

Details for the file openmind_hub_guozr-1.2.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for openmind_hub_guozr-1.2.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 8094692cbe2a2889af6b41603323e906af6dbde3a5272746667cc0eb66313d43
MD5 b5ac4c5d93e46996cd9eb9bac4ff6991
BLAKE2b-256 ba0623be9b3a3a95fb569db01d50917e43b732c0df1fbfb4f041268a708bb597

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