Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
liuzx 2be5a2da25 | 6 months ago | |
---|---|---|
media | 8 months ago | |
src/openi | 6 months ago | |
.gitignore | 7 months ago | |
LISCENCE | 11 months ago | |
README.md | 7 months ago | |
example.py | 7 months ago | |
setup.py | 6 months ago |
PYPI package for 启智AI协作平台。
适配python3.6及以上版本
PYPI package for 启智 AI 协作平台。
适配 python3.6 及以上版本
pip3 install -U openi_test
pip install openi-test==0.5.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
dataset.upload_file(file, username, repository, token, cluster = "NPU")
file
str, 必填:文件路径(包含文件名,支持linux与mac路径,也支持windows文件路径如d:\xxx)username
str, 必填:上传数据集所属项目owner用户名,可以是用户或组织repository
str, 必填:数据集所属项目路径,此为仓库地址中的名字,更改过名称的项目需填写仓库地址中的路径token
str, 必填:用户启智上获取的令牌token,并对该数据集有权限cluster
str, 选填, 默认"NPU":可填入GPU或NPU,上传至不同的存储集群
from openi.dataset import upload_file
upload_file(
file = "", # 必填,文件路径(包含文件名)
username = "", # 必填,数据集所属项目用户名
repository = "", # 必填,数据集所属项目名
token = "", #必填,用户启智上获取的令牌token,并对该项目数据集有权限
cluster = "", # 选填,可填入GPU或NPU,不填写后台默认为NPU
app_url = "" #选填, 默认为平台地址,用户不用填写,开发测试用
file = "",
username = "",
repository = "",
token = "",
cluster = ""
)
界面
from openi.dataset import download_file
download_file(
file="my_data.zip",
repo_id="user1/repo1",
cluster="gpu",
save_path="local_path/",
)
""" output
Complete( my_data.zip)(gpu): 100%|██████████████████████████████████████████| 22.0MB/22.0MB [00:01<00:00, 15.9MB/s]
"""
>>> openi
usage: openi {login, whoami, dataset, ...} [<args>] [-h]
OpenI command line tool 启智AI协作平台命令行工具
commands:
{login,logout,whoami,dataset,d,model,m}
login 使用令牌登录启智并保存到本机
logout 登出当前用户并删除本地令牌文件
whoami 查询当前登录用户
dataset (d) {upload,download} 上传/下载启智AI协作平台的数据集
model (m) {upload,download} 上传/下载启智AI协作平台的模型
>>> openi login
██████╗ ██████╗ ███████╗ ███╗ ██╗ ██████╗
██╔═══██╗ ██╔══██╗ ██╔════╝ ████╗ ██║ ██╔═╝
██║ ██║ ██████╔╝ █████╗ ██╔██╗ ██║ ██║
██║ ██║ ██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║
╚██████╔╝ ██║ ███████╗ ██║ ╚████║ ██████╗
╚═════╝ ╚═╝ ╚══════╝ ╚═╝ ╚═══╝ ╚═════╝
点击链接获取令牌并复制粘贴到下列输入栏 https://openi.pcl.ac.cn/user/settings/applications
[WARNING] 若本机已存在登录令牌,本次输入的令牌会将其覆盖
粘贴前请先按 退格键⇦ 删除多余空格
🔒 token:
#公共方法
#导入用于下载的函数
from openi.cloudbrain.download import download_code, download_dataset, download_pretrain_model
#导入用于获取路径的函数
from openi.cloudbrain.path import get_code_path, get_dataset_path, get_pretrain_model_path, get_output_path
#导入用于上传的函数
from openi.cloudbrain.upload import upload_output
#从云上下载代码,数据集,预训练模型到容器内
download_code()
#从云上下载数据集
download_dataset()
#从云上下载预训练模型
download_pretrain_model()
#获取代码本地路径
code_path = get_code_path()
print(code_path)
#数据集本地路径
data_path = get_dataset_path()
print(data_path)
#预训练模型本地路径
pretrain_model_path = get_pretrain_model_path()
print(pretrain_model_path)
#输出路径
output_path = get_output_path()
print(output_path)
#回传结果到云上
upload_output()
test
No Description
Python
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》