From 1dff3c8fa9bf4c052a9b207b25133b89bfdc77e9 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 23 Aug 2024 11:01:21 +0800 Subject: [PATCH 1/6] [docs] update upload model doc --- docs/models/uploading.md | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/models/uploading.md b/docs/models/uploading.md index e7db299..79a8953 100644 --- a/docs/models/uploading.md +++ b/docs/models/uploading.md @@ -12,3 +12,49 @@ 5. 前往模型详情页,[编辑模型卡片](/models/cards#编辑模型卡片),填写模型的元信息和描述。 + +### 使用 `gai` 命令行工具上传模型 + +如果模型仓库中文件尺寸较大,推荐使用 `gai` 命令行工具上传。 +```bash +# 前往 https://git-lfs.com 下载 git-lfs,然后安装 Git LFS +git lfs install + +# 安装 Gitee AI CLI +/bin/bash -c "$(curl -fsSL https://gitee.com/gitee-ai/cli/raw/master/install.sh)" + +# 检查 Gitee AI CLI 版本 +gai version + +# 访问 https://gitee.com/profile/personal_access_tokens 获取 Gitee 私人令牌 +# 创建 Gitee AI 访问令牌详见: https://ai.gitee.com/docs/organization/access-token +# 全局配置 Gitee AI 和 Gitee 访问令牌 +gai config --global gitee-token +gai config --global gitee-ai-token + + +# 在线创建模型仓库之后,克隆到本地 +git clone https://ai.gitee.com// + +# 切换工作目录到本地模型仓库 +cd + +# 除了全局配置令牌,还可以为本地模型仓库配置令牌 +# 配置 Gitee token +gai config gitee-token +# 配置 Gitee AI token +gai config gitee-ai-token + +# 为本地仓库初始化 gai 配置 +gai config init + +# 配置需要上传到 Git LFS 的文件类型, 比如 *.bin 文件 +git lfs track "*.bin" + +# 拷贝大文件到当前目录并提交 +cp ~//model.safetensors . +git add . && git commit -m 'Add model.safetensors file' + +# 将更新推送到 Gitee AI 模型、数据集仓库 +git push origin master +``` -- Gitee From 001b79ba03c18aa36f8f6e46efe167b99549bda0 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 23 Aug 2024 11:22:17 +0800 Subject: [PATCH 2/6] [docs] update upload docs --- docs/datasets/uploading.md | 43 ++++++++++++++++++++++++++++++++++++++ docs/models/uploading.md | 16 ++++++-------- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/docs/datasets/uploading.md b/docs/datasets/uploading.md index 6b2e646..b501ea5 100644 --- a/docs/datasets/uploading.md +++ b/docs/datasets/uploading.md @@ -16,3 +16,46 @@ Gitee AI 拥有大量数据集。我们鼓励您将数据集分享到社区, 5. 前往模型详情页,[编辑数据集卡片](/datasets/cards#编辑数据集卡片),填写模型的元信息和描述。 + +### 使用 `gai` 命令行工具上传数据集 + +对于大型数据集文件,推荐使用 `gai` 命令行工具上传。 + +```bash +# 前往 https://git-lfs.com 下载 git-lfs,然后安装 Git LFS +git lfs install + +# 安装 Gitee AI CLI +/bin/bash -c "$(curl -fsSL https://gitee.com/gitee-ai/cli/raw/master/install.sh)" + +# 检查 Gitee AI CLI 版本 +gai version + +# 访问 https://gitee.com/profile/personal_access_tokens 获取 Gitee 私人令牌 +# 创建 Gitee AI 访问令牌详见: https://ai.gitee.com/docs/organization/access-token +# 全局配置 Gitee AI 和 Gitee 访问令牌 +gai config --global gitee-token +gai config --global gitee-ai-token + +# 在线创建数据集仓库见文档 https://ai.gitee.com/docs/repositories#%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93 +# 在线创建数据集仓库之后,克隆到本地 +git clone https://ai.gitee.com// +cd + +# 除了全局配置令牌,还可以为本地模型仓库配置令牌 +gai config gitee-token +gai config gitee-ai-token + +# 为本地仓库初始化 gai 配置 +gai config init + +# 配置需要上传到 Git LFS 的文件类型, 比如 *.json, *.zip, *.parquet 文件等 +git lfs track "*.json" "*.zip" "*.parquet" + +# 添加数据集文件到本地仓库 +cp -r ~/datasets/your_dataset_folder/ . +git add . && git commit -m 'Add dataset files' + +# 将更新推送到 Gitee AI 数据集仓库 +git push origin master +``` \ No newline at end of file diff --git a/docs/models/uploading.md b/docs/models/uploading.md index 79a8953..0c67806 100644 --- a/docs/models/uploading.md +++ b/docs/models/uploading.md @@ -15,7 +15,7 @@ ### 使用 `gai` 命令行工具上传模型 -如果模型仓库中文件尺寸较大,推荐使用 `gai` 命令行工具上传。 +如果模型仓库中文件较大,推荐使用 `gai` 命令行工具上传。 ```bash # 前往 https://git-lfs.com 下载 git-lfs,然后安装 Git LFS git lfs install @@ -32,29 +32,25 @@ gai version gai config --global gitee-token gai config --global gitee-ai-token - +# 在线创建模型仓库见文档 https://ai.gitee.com/docs/repositories#%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93 # 在线创建模型仓库之后,克隆到本地 git clone https://ai.gitee.com// - -# 切换工作目录到本地模型仓库 cd # 除了全局配置令牌,还可以为本地模型仓库配置令牌 -# 配置 Gitee token gai config gitee-token -# 配置 Gitee AI token gai config gitee-ai-token # 为本地仓库初始化 gai 配置 gai config init -# 配置需要上传到 Git LFS 的文件类型, 比如 *.bin 文件 -git lfs track "*.bin" +# 配置需要上传到 Git LFS 的文件类型, 比如 *.bin, *.safetensors, *.ckpt 文件等 +git lfs track "*.bin" "*.safetensors" "*.ckpt" -# 拷贝大文件到当前目录并提交 +# 添加模型文件到本地仓库 cp ~//model.safetensors . git add . && git commit -m 'Add model.safetensors file' -# 将更新推送到 Gitee AI 模型、数据集仓库 +# 将更新推送到 Gitee AI 模型仓库 git push origin master ``` -- Gitee From 9e505058a365bfcd9d9f2ba18024c69d8fad5f93 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 23 Aug 2024 11:43:58 +0800 Subject: [PATCH 3/6] [docs] update upload docs using mdx --- docs/models/{uploading.md => uploading.mdx} | 2 +- src/components/GaiREADME.jsx | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/models/{uploading.md => uploading.mdx} (93%) create mode 100644 src/components/GaiREADME.jsx diff --git a/docs/models/uploading.md b/docs/models/uploading.mdx similarity index 93% rename from docs/models/uploading.md rename to docs/models/uploading.mdx index 0c67806..54ff328 100644 --- a/docs/models/uploading.md +++ b/docs/models/uploading.mdx @@ -15,7 +15,7 @@ ### 使用 `gai` 命令行工具上传模型 -如果模型仓库中文件较大,推荐使用 `gai` 命令行工具上传。 +如果模型仓库中文件较大,Git 推送出现上传缓慢或上传失败的情况,推荐使用 `gai` 命令行工具上传。 ```bash # 前往 https://git-lfs.com 下载 git-lfs,然后安装 Git LFS git lfs install diff --git a/src/components/GaiREADME.jsx b/src/components/GaiREADME.jsx new file mode 100644 index 0000000..e69de29 -- Gitee From 5074cb4e5b1e5bfabaeefa1a65aa6c7c12d4fb58 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 23 Aug 2024 11:46:30 +0800 Subject: [PATCH 4/6] [docs] update upload docs using mdx --- docs/models/uploading.mdx | 5 +++++ src/components/GaiREADME.jsx | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/docs/models/uploading.mdx b/docs/models/uploading.mdx index 54ff328..6f87477 100644 --- a/docs/models/uploading.mdx +++ b/docs/models/uploading.mdx @@ -1,3 +1,5 @@ +import RemoteReadme from "@site/src/components/GaiREADME"; + # 模型上传 请先参考[仓库](/repositories#克隆仓库)文档: @@ -16,6 +18,9 @@ ### 使用 `gai` 命令行工具上传模型 如果模型仓库中文件较大,Git 推送出现上传缓慢或上传失败的情况,推荐使用 `gai` 命令行工具上传。 + + + ```bash # 前往 https://git-lfs.com 下载 git-lfs,然后安装 Git LFS git lfs install diff --git a/src/components/GaiREADME.jsx b/src/components/GaiREADME.jsx index e69de29..46ff7a2 100644 --- a/src/components/GaiREADME.jsx +++ b/src/components/GaiREADME.jsx @@ -0,0 +1,17 @@ +import React, {useState, useEffect} from "react"; +import ReactMarkdown from 'react-markdown'; + +const RemoteReadme = ({url}) => { + const [content, setContent] = useState(''); + + useEffect(() => { + fetch(url) + .then(response => response.text()) + .then(setContent) + .catch(error => console.error('Error fetching README:', error)); + }, [url]); + + return {content}; +}; + +export default RemoteReadme; -- Gitee From 44312c56ebe4a97835ecf988d5749c26c6d7ece5 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 23 Aug 2024 14:22:42 +0800 Subject: [PATCH 5/6] [docs] update upload docs using gai remote content --- docs/datasets/uploading.md | 41 +---- docs/gai.md | 88 +++++++++++ docs/models/{uploading.mdx => uploading.md} | 45 +----- docusaurus.config.ts | 18 +++ package.json | 3 +- src/components/GaiREADME.jsx | 17 --- yarn.lock | 157 +++++++++++++++++++- 7 files changed, 264 insertions(+), 105 deletions(-) create mode 100644 docs/gai.md rename docs/models/{uploading.mdx => uploading.md} (30%) delete mode 100644 src/components/GaiREADME.jsx diff --git a/docs/datasets/uploading.md b/docs/datasets/uploading.md index b501ea5..1099126 100644 --- a/docs/datasets/uploading.md +++ b/docs/datasets/uploading.md @@ -19,43 +19,4 @@ Gitee AI 拥有大量数据集。我们鼓励您将数据集分享到社区, ### 使用 `gai` 命令行工具上传数据集 -对于大型数据集文件,推荐使用 `gai` 命令行工具上传。 - -```bash -# 前往 https://git-lfs.com 下载 git-lfs,然后安装 Git LFS -git lfs install - -# 安装 Gitee AI CLI -/bin/bash -c "$(curl -fsSL https://gitee.com/gitee-ai/cli/raw/master/install.sh)" - -# 检查 Gitee AI CLI 版本 -gai version - -# 访问 https://gitee.com/profile/personal_access_tokens 获取 Gitee 私人令牌 -# 创建 Gitee AI 访问令牌详见: https://ai.gitee.com/docs/organization/access-token -# 全局配置 Gitee AI 和 Gitee 访问令牌 -gai config --global gitee-token -gai config --global gitee-ai-token - -# 在线创建数据集仓库见文档 https://ai.gitee.com/docs/repositories#%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93 -# 在线创建数据集仓库之后,克隆到本地 -git clone https://ai.gitee.com// -cd - -# 除了全局配置令牌,还可以为本地模型仓库配置令牌 -gai config gitee-token -gai config gitee-ai-token - -# 为本地仓库初始化 gai 配置 -gai config init - -# 配置需要上传到 Git LFS 的文件类型, 比如 *.json, *.zip, *.parquet 文件等 -git lfs track "*.json" "*.zip" "*.parquet" - -# 添加数据集文件到本地仓库 -cp -r ~/datasets/your_dataset_folder/ . -git add . && git commit -m 'Add dataset files' - -# 将更新推送到 Gitee AI 数据集仓库 -git push origin master -``` \ No newline at end of file +如果数据集仓库中文件较大,Git 推送出现上传缓慢或上传失败的情况,推荐使用 `gai` 命令行工具上传,详见 [Gitee AI CLI 文档](/gai)。 diff --git a/docs/gai.md b/docs/gai.md new file mode 100644 index 0000000..214a288 --- /dev/null +++ b/docs/gai.md @@ -0,0 +1,88 @@ +# Gitee AI 命令行工具 + +#### 介绍 +Gitee AI 命令行工具是一款专为开发者设计的高效工具,帮助用户轻松地将模型和数据集上传到 Gitee AI 平台。 + + +#### 安装教程 + +安装 Git LFS 和 Gitee AI CLI 以及配置 Gitee AI CLI +```bash +# 前往 https://git-lfs.com 下载 git-lfs,然后安装 Git LFS +git lfs install + +# 安装 Gitee AI CLI +/bin/bash -c "$(curl -fsSL https://gitee.com/gitee-ai/cli/raw/master/install.sh)" + +# 检查 Gitee AI CLI 版本 +gai version + +# 访问 https://gitee.com/profile/personal_access_tokens 获取 Gitee 私人令牌 +# 创建 Gitee AI 访问令牌详见: https://ai.gitee.com/docs/organization/access-token +# 全局配置 Gitee AI 和 Gitee 访问令牌 +gai config --global gitee-token +gai config --global gitee-ai-token + + +# 要为本地 Gitee 仓库配置令牌,请使用以下命令: +cd + +# 配置 Gitee token +gai config gitee-token +# 配置 Gitee AI token +gai config gitee-ai-token +``` + + + +#### 使用说明 + +推送大文件到 Gitee AI 模型、数据集仓库 +```bash + +# 在 Gitee AI 上创建模型、数据集仓库并 Clone 到本地 +git clone https://ai.gitee.com// +cd + +# 为本地仓库初始化 Gitee AI Cli 配置 +gai config init + +# 配置需要上传到 Git LFS 的文件类型, 比如 *.bin 文件 +git lfs track "*.bin" + +# 拷贝大文件到当前目录并提交 +cp ~//model.safetensors . +git add . && git commit -m 'Add model.safetensors file' + +# 将更新推送到 Gitee AI 模型、数据集仓库 +git push origin master +``` + +##### Windows 系统下使用说明 + +**建议在 WSL Ubuntu 22.04 LTS 或更高版本系统下使用**, 如果在执行 `gai config gitee-token ` 命令时遇到卡住问题, 请尝试执行以下命令, 然后继续配置您的 token: + + +```bash +dbus-run-session -- bash --noprofile --norc +# 如有需要,提前备份您的密钥环 +rm -rf ~/.local/share/keyrings +echo -n 'db' | gnome-keyring-daemon --unlock +``` + +#### 参与贡献 + +1. Fork 本仓库 +2. 新建 Feat_xxx 分支 +3. 提交代码 +4. 新建 Pull Request + + +#### 特技 + +1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md +2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) +3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 +4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 +5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) +6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/docs/models/uploading.mdx b/docs/models/uploading.md similarity index 30% rename from docs/models/uploading.mdx rename to docs/models/uploading.md index 6f87477..e7acc58 100644 --- a/docs/models/uploading.mdx +++ b/docs/models/uploading.md @@ -1,5 +1,3 @@ -import RemoteReadme from "@site/src/components/GaiREADME"; - # 模型上传 请先参考[仓库](/repositories#克隆仓库)文档: @@ -17,45 +15,4 @@ import RemoteReadme from "@site/src/components/GaiREADME"; ### 使用 `gai` 命令行工具上传模型 -如果模型仓库中文件较大,Git 推送出现上传缓慢或上传失败的情况,推荐使用 `gai` 命令行工具上传。 - - - -```bash -# 前往 https://git-lfs.com 下载 git-lfs,然后安装 Git LFS -git lfs install - -# 安装 Gitee AI CLI -/bin/bash -c "$(curl -fsSL https://gitee.com/gitee-ai/cli/raw/master/install.sh)" - -# 检查 Gitee AI CLI 版本 -gai version - -# 访问 https://gitee.com/profile/personal_access_tokens 获取 Gitee 私人令牌 -# 创建 Gitee AI 访问令牌详见: https://ai.gitee.com/docs/organization/access-token -# 全局配置 Gitee AI 和 Gitee 访问令牌 -gai config --global gitee-token -gai config --global gitee-ai-token - -# 在线创建模型仓库见文档 https://ai.gitee.com/docs/repositories#%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93 -# 在线创建模型仓库之后,克隆到本地 -git clone https://ai.gitee.com// -cd - -# 除了全局配置令牌,还可以为本地模型仓库配置令牌 -gai config gitee-token -gai config gitee-ai-token - -# 为本地仓库初始化 gai 配置 -gai config init - -# 配置需要上传到 Git LFS 的文件类型, 比如 *.bin, *.safetensors, *.ckpt 文件等 -git lfs track "*.bin" "*.safetensors" "*.ckpt" - -# 添加模型文件到本地仓库 -cp ~//model.safetensors . -git add . && git commit -m 'Add model.safetensors file' - -# 将更新推送到 Gitee AI 模型仓库 -git push origin master -``` +如果模型仓库中文件较大,Git 推送出现上传缓慢或上传失败的情况,推荐使用 `gai` 命令行工具上传,详见 [Gitee AI CLI 文档](/gai)。 diff --git a/docusaurus.config.ts b/docusaurus.config.ts index d913dcb..4ae2ef2 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -252,6 +252,24 @@ const config: Config = { }, } as ScalarOptions, ], + [ + 'docusaurus-plugin-remote-content', + { + name: 'gai-readme', + sourceBaseUrl: 'https://gitee.com/gitee-ai/cli/raw/master/', + outDir: 'docs', + documents: ['README.md'], + modifyContent: (filename, content) => { + if (filename === 'README.md') { + return { + filename: 'gai.md', + content: content, + } + } + return undefined + }, + }, + ], ], }; diff --git a/package.json b/package.json index e4c2c91..1dd810f 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "clsx": "^2.0.0", "docusaurus": "^1.14.7", "docusaurus-plugin-image-zoom": "^2.0.0", + "docusaurus-plugin-remote-content": "^4.0.0", "patch-package": "^8.0.0", "postinstall-postinstall": "^2.1.0", "prism-react-renderer": "^2.3.0", @@ -51,4 +52,4 @@ "engines": { "node": ">=18.0" } -} \ No newline at end of file +} diff --git a/src/components/GaiREADME.jsx b/src/components/GaiREADME.jsx deleted file mode 100644 index 46ff7a2..0000000 --- a/src/components/GaiREADME.jsx +++ /dev/null @@ -1,17 +0,0 @@ -import React, {useState, useEffect} from "react"; -import ReactMarkdown from 'react-markdown'; - -const RemoteReadme = ({url}) => { - const [content, setContent] = useState(''); - - useEffect(() => { - fetch(url) - .then(response => response.text()) - .then(setContent) - .catch(error => console.error('Error fetching README:', error)); - }, [url]); - - return {content}; -}; - -export default RemoteReadme; diff --git a/yarn.lock b/yarn.lock index aeb35ca..65ab018 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3205,6 +3205,18 @@ dependencies: "@swc/helpers" "^0.5.0" +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.npmmirror.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@jest/schemas@^29.6.3": version "29.6.3" resolved "https://registry.npmmirror.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" @@ -3403,6 +3415,11 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.npmmirror.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@pnpm/config.env-replace@^1.1.0": version "1.1.0" resolved "https://registry.npmmirror.com/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz#ab29da53df41e8948a00f2433f085f54de8b3a4c" @@ -4811,7 +4828,7 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.1.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -5109,6 +5126,15 @@ aws4@^1.8.0: resolved "https://registry.npmmirror.com/aws4/-/aws4-1.13.1.tgz#bb5f8b8a20739f6ae1caeaf7eea2c7913df8048e" integrity sha512-u5w79Rd7SU4JaIlA/zFqG+gOiuq25q5VLyZ8E+ijJeILuTxVzZgp2CaGw/UTw6pXYN9XMO9yiqj/nEHmhTG5CA== +axios@^1.6.0: + version "1.7.4" + resolved "https://registry.npmmirror.com/axios/-/axios-1.7.4.tgz#4c8ded1b43683c8dd362973c393f3ede24052aa2" + integrity sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axios@^1.6.8: version "1.7.2" resolved "https://registry.npmmirror.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621" @@ -5363,6 +5389,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^2.3.1: version "2.3.2" resolved "https://registry.npmmirror.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" @@ -6206,7 +6239,7 @@ crelt@^1.0.5: resolved "https://registry.npmmirror.com/crelt/-/crelt-1.0.6.tgz#7cc898ea74e190fb6ef9dae57f8f81cf7302df72" integrity sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g== -cross-spawn@7.0.3, cross-spawn@^7.0.3: +cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -6894,6 +6927,16 @@ docusaurus-plugin-image-zoom@^2.0.0: medium-zoom "^1.0.8" validate-peer-dependencies "^2.2.0" +docusaurus-plugin-remote-content@^4.0.0: + version "4.0.0" + resolved "https://registry.npmmirror.com/docusaurus-plugin-remote-content/-/docusaurus-plugin-remote-content-4.0.0.tgz#2e8980a5ec7be543eec9f715624bc81cd92e45be" + integrity sha512-e+gBmNdgOwA+7u6O2kk/u1w4ET23j8OIF6OiOWV6EoKHJJ/w/8U5smkHNlrQC3hQOltxE2NRC1jbsG7wfS+d3w== + dependencies: + axios "^1.6.0" + picocolors "^1.0.0" + pretty-ms "^7.0.1" + rimraf "^5.0.5" + docusaurus@^1.14.7: version "1.14.7" resolved "https://registry.npmmirror.com/docusaurus/-/docusaurus-1.14.7.tgz#f51858ab643b29ec52264d6dd85e0d629e5b3a4a" @@ -8013,6 +8056,14 @@ for-in@^1.0.2: resolved "https://registry.npmmirror.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== +foreground-child@^3.1.0: + version "3.3.0" + resolved "https://registry.npmmirror.com/foreground-child/-/foreground-child-3.3.0.tgz#0ac8644c06e431439f8561db8ecf29a7b5519c77" + integrity sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.npmmirror.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -8333,6 +8384,18 @@ glob-to-regexp@^0.4.1: resolved "https://registry.npmmirror.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== +glob@^10.3.7: + version "10.4.5" + resolved "https://registry.npmmirror.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" + integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== + dependencies: + foreground-child "^3.1.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" + glob@^7.0.0, glob@^7.0.5, glob@^7.1.2, glob@^7.1.3, glob@^7.1.6: version "7.2.3" resolved "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -9911,6 +9974,15 @@ isurl@^1.0.0-alpha5: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" +jackspeak@^3.1.2: + version "3.4.3" + resolved "https://registry.npmmirror.com/jackspeak/-/jackspeak-3.4.3.tgz#8833a9d89ab4acde6188942bd1c53b6390ed5a8a" + integrity sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-util@^29.7.0: version "29.7.0" resolved "https://registry.npmmirror.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" @@ -10429,6 +10501,11 @@ lpad-align@^1.0.1: longest "^1.0.0" meow "^3.3.0" +lru-cache@^10.2.0: + version "10.4.3" + resolved "https://registry.npmmirror.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.npmmirror.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -11362,6 +11439,13 @@ minimatch@3.1.2, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + minimatch@~3.0.2: version "3.0.8" resolved "https://registry.npmmirror.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1" @@ -11374,6 +11458,11 @@ minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.6: resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.npmmirror.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + mixin-deep@^1.1.3, mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.npmmirror.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" @@ -11922,6 +12011,11 @@ p-try@^2.0.0: resolved "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +package-json-from-dist@^1.0.0: + version "1.0.0" + resolved "https://registry.npmmirror.com/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz#e501cd3094b278495eb4258d4c9f6d5ac3019f00" + integrity sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw== + package-json@^8.1.0: version "8.1.1" resolved "https://registry.npmmirror.com/package-json/-/package-json-8.1.1.tgz#3e9948e43df40d1e8e78a85485f1070bf8f03dc8" @@ -11986,6 +12080,11 @@ parse-json@^5.0.0, parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +parse-ms@^2.1.0: + version "2.1.0" + resolved "https://registry.npmmirror.com/parse-ms/-/parse-ms-2.1.0.tgz#348565a753d4391fa524029956b172cb7753097d" + integrity sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA== + parse-ms@^3.0.0: version "3.0.0" resolved "https://registry.npmmirror.com/parse-ms/-/parse-ms-3.0.0.tgz#3ea24a934913345fcc3656deda72df921da3a70e" @@ -12114,6 +12213,14 @@ path-root@^0.1.1: dependencies: path-root-regex "^0.1.0" +path-scurry@^1.11.1: + version "1.11.1" + resolved "https://registry.npmmirror.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -12896,6 +13003,13 @@ pretty-format@^29.7.0: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-ms@^7.0.1: + version "7.0.1" + resolved "https://registry.npmmirror.com/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8" + integrity sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q== + dependencies: + parse-ms "^2.1.0" + pretty-ms@^8.0.0: version "8.0.0" resolved "https://registry.npmmirror.com/pretty-ms/-/pretty-ms-8.0.0.tgz#a35563b2a02df01e595538f86d7de54ca23194a3" @@ -13901,6 +14015,13 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" +rimraf@^5.0.5: + version "5.0.10" + resolved "https://registry.npmmirror.com/rimraf/-/rimraf-5.0.10.tgz#23b9843d3dc92db71f96e1a2ce92e39fd2a8221c" + integrity sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ== + dependencies: + glob "^10.3.7" + rst-selector-parser@^2.2.3: version "2.2.3" resolved "https://registry.npmmirror.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" @@ -14291,6 +14412,11 @@ signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + simple-swizzle@^0.2.2: version "0.2.2" resolved "https://registry.npmmirror.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" @@ -14609,6 +14735,15 @@ string-template@~0.2.1: resolved "https://registry.npmmirror.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" integrity sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw== +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -14691,6 +14826,13 @@ stringify-object@3.3.0, stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@6.0.0: version "6.0.0" resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" @@ -14705,7 +14847,7 @@ strip-ansi@^3.0.0: dependencies: ansi-regex "^2.0.0" -strip-ansi@^6.0.1: +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15924,6 +16066,15 @@ worker-rpc@^0.1.0: dependencies: microevent.ts "~0.1.1" +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" -- Gitee From f809d2be2ac4b5f40d7048028a9e3c9f23e1a64e Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 23 Aug 2024 15:24:50 +0800 Subject: [PATCH 6/6] =?UTF-8?q?[docs]=20=E6=94=B9=E5=86=99=20gai=20?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/gai.md | 19 +------------------ docusaurus.config.ts | 21 ++++++++++++++++++++- sidebars.ts | 4 ++++ 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/docs/gai.md b/docs/gai.md index 214a288..43306cf 100644 --- a/docs/gai.md +++ b/docs/gai.md @@ -1,4 +1,4 @@ -# Gitee AI 命令行工具 +# 使用 Gitee AI 命令行工具上传模型 #### 介绍 Gitee AI 命令行工具是一款专为开发者设计的高效工具,帮助用户轻松地将模型和数据集上传到 Gitee AI 平台。 @@ -69,20 +69,3 @@ dbus-run-session -- bash --noprofile --norc rm -rf ~/.local/share/keyrings echo -n 'db' | gnome-keyring-daemon --unlock ``` - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 4ae2ef2..8c2f694 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -261,8 +261,27 @@ const config: Config = { documents: ['README.md'], modifyContent: (filename, content) => { if (filename === 'README.md') { + const lines = content.split('\n'); + + // 修改标题 + const titleIndex = lines.findIndex(line => line.trim() === '# Gitee AI 命令行工具'); + if (titleIndex !== -1) { + lines[titleIndex] = '# 使用 Gitee AI 命令行工具上传模型'; + } + + // 参与贡献之后的行都不要 + const idx = lines.findIndex(line => line.includes('参与贡献')); + + const fn = 'gai.md'; + if (idx !== -1) { + const newContent = lines.slice(0, idx).join('\n'); + return { + filename: fn, + content: newContent, + } + } return { - filename: 'gai.md', + filename: fn, content: content, } } diff --git a/sidebars.ts b/sidebars.ts index 799748d..9ea2be9 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -60,6 +60,10 @@ const sidebars: SidebarsConfig = { type: 'doc', id: 'models/uploading', }, + { + type: 'doc', + id: 'gai', + }, { type: 'doc', id: 'models/downloading', -- Gitee