diff --git a/files_in_srpm.txt b/files_in_srpm.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1699649118ab2c1d1dedb3bc05afb09d8daeeb4 --- /dev/null +++ b/files_in_srpm.txt @@ -0,0 +1,2 @@ +openmind_hub-0.9.1-py3-none-any.whl +python-openmind-hub.spec diff --git a/openmind_hub-0.9.1-py3-none-any.whl b/openmind_hub-0.9.1-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..7121a0aa6972cf0ec13df740421b9d462fe56838 Binary files /dev/null and b/openmind_hub-0.9.1-py3-none-any.whl differ diff --git a/python-openmind-hub.spec b/python-openmind-hub.spec new file mode 100644 index 0000000000000000000000000000000000000000..67e45536a16ae35c10c619d940872c4f06aa5827 --- /dev/null +++ b/python-openmind-hub.spec @@ -0,0 +1,84 @@ +Name: python-openmind-hub +Version: 0.9.1 +Release: 1%{?dist} +Summary: Hub client SDK for openMind +License: 木兰宽松许可证, 第2版 +URL: https://gitee.com/openmind-ai/openmind-hub +Source0: https://mirrors.aliyun.com/pypi/web/packages/c8/9a/d8b395d92eba188ff5af36674168f219dd5b3978925037a429ffecd1ec2c/openmind_hub-0.9.1-py3-none-any.whl + +BuildArch: noarch + +Provides: python-openmind-hub +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-wheel + +%description +# openMind Hub Client + +## 简介 + +openMind Hub Client可以帮助您在不离开开发环境的情况下与社区进行交互。您可以轻松创建和管理仓库,下载和上传文件以及从模型库获取有用的模型和数据集元数据。 + +## 安装 + +关于openMind Hub Client的安装步骤,推荐用户参考[《安装》](./docs/zh/install.md)文档,以确保顺利并正确地完成安装过程。 + +## 下载文件 + +例如,下载[t5_small](https://modelers.cn/models/PyTorch-NPU/t5_small/)模型配置文件: + +```py +from openmind_hub import om_hub_download + +om_hub_download(repo_id="PyTorch-NPU/t5_small", filename="config.json") +``` + +详见[《下载指南》](./docs/zh/basic_tutorial/download.md)。 + +## 访问令牌 + +访问私有仓库资源、创建仓库和上传文件等场景都需要使用访问令牌(即token)才能与社区进行交互。请[创建访问令牌](https://modelers.cn/my/tokens)并妥善保存,令牌内容仅会在创建时显示。 + +## 上传文件 + +使用`upload_folder`为您的仓库上传文件,示例如下: + +```py +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")`。 + +详见[《上传文件》](./docs/zh/basic_tutorial/upload.md)。 + +## 安全声明 + +为保障使用过程安全,推荐用户参考[《安全声明》](./security_statement.md)了解相关安全信息,进行必要的安全加固。 + +%prep +%setup -q -c -T +unzip -q %{SOURCE0} -d %{_builddir}/%{name}-%{version} + +%build +# No build step required + +%install +mkdir -p %{buildroot}%{python3_sitelib} +cp -r %{_builddir}/%{name}-%{version}/* %{buildroot}%{python3_sitelib} + +%files +%doc +%{python3_sitelib}/* + +%changelog +* Wed Mar 12 2025 Python_Bot - 0.9.1-1 +- Package Spec generated diff --git a/python-openmind-hub.src.rpm b/python-openmind-hub.src.rpm new file mode 100644 index 0000000000000000000000000000000000000000..f3ab90ddf2c8c57e6b686fa73b8e564c88511a3a Binary files /dev/null and b/python-openmind-hub.src.rpm differ