Skip to content

Commit

Permalink
examples en
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyi-Lin committed Dec 3, 2024
1 parent 5c318cc commit d2b268d
Show file tree
Hide file tree
Showing 34 changed files with 3,420 additions and 104 deletions.
204 changes: 100 additions & 104 deletions .vitepress/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ export const en = defineConfig({
link: base_path_guide_cloud + '/general/what-is-swanlab',
activeMatch: '/en/guide_cloud/',
},
// {
// text: '案例',
// link: base_path_examples + '/mnist',
// activeMatch: '/en/examples/',
// },
// {
// text: 'API',
// link: base_path_api + '/api-index',
// activeMatch: '/en/api/',
// },
{
text: 'Example',
link: base_path_examples + '/mnist',
activeMatch: '/en/examples/',
},
{
text: 'API',
link: base_path_api + '/api-index',
activeMatch: '/en/api/',
},
{ text: 'v0.3.27', items: [
{ text: 'changelog', link: base_path_guide_cloud + '/general/changelog' },
// { text: '参与贡献', link: 'https://github.com/SwanHubX/SwanLab/blob/main/CONTRIBUTING.md' },
// { text: '建议反馈', link: 'https://geektechstudio.feishu.cn/share/base/form/shrcn8koDFRcH2mMcBYMh9tiKfI'}
{ text: 'Contribution', link: 'https://github.com/SwanHubX/SwanLab/blob/main/CONTRIBUTING.md' },
{ text: 'Feedback', link: 'https://geektechstudio.feishu.cn/share/base/form/shrcn8koDFRcH2mMcBYMh9tiKfI'}
] },
// { text: '在线交流', link: '/en/guide_cloud/community/online-support'},
{ text: 'Website', link: 'https://swanlab.cn' },
Expand Down Expand Up @@ -70,8 +70,8 @@ export const en = defineConfig({
// 侧边栏配置
sidebar: {
'/en/guide_cloud/':{base: '/en/guide_cloud/', items: sidebarGuideCloud(),},
// '/en/examples/':{base: '/en/examples/', items: sidebarExamples(),},
// '/en/api/':{base: '/en/api/', items: sidebarAPI(),},
'/en/examples/':{base: '/en/examples/', items: sidebarExamples(),},
'/en/api/':{base: '/en/api/', items: sidebarAPI(),},
},

// 页脚配置
Expand Down Expand Up @@ -155,98 +155,94 @@ function sidebarGuideCloud(): DefaultTheme.SidebarItem[] {
{ text: 'ZhipuAI', link: 'integration/integration-zhipuai'},
]
},
]
{
text: '👥 Community',
// collapsed: false,
items: [
{ text: 'Online support', link: 'community/online-support'},
{ text: 'Github badge', link: 'community/github-badge'},
{ text: 'Paper citation', link: 'community/paper-cite'},
{ text: 'Contributing code', link: 'community/contributing-code'},
{ text: 'Contributing docs', link: 'community/contributing-docs'},
{ text: 'Contributor', link: 'community/contributor'},
{ text: 'About us', link: 'community/emotion-machine'},
]
},]
}



function sidebarExamples(): DefaultTheme.SidebarItem[] {
return [{
text: 'Quick Start',
// collapsed: false,
items: [
{ text: 'Hello_World', link: 'hello_world' },
{ text: 'MNIST Handwriting Recognition', link: 'mnist' },
]
},
{
text: 'Computer Vision',
// collapsed: false,
items: [
{ text: 'FashionMNIST', link: 'fashionmnist' },
{ text: 'Cats and Dogs Classification', link: 'cats_dogs_classification' },
{ text: 'Yolo Object Detection', link: 'yolo' },
]
},
{
text: 'NLP',
// collapsed: false,
items: [
{ text: 'BERT Text Classification', link: 'bert' },
{ text: 'Qwen Finetune Case', link: 'qwen_finetune' },
{ text: 'LLM Pretraining', link: 'pretrain_llm' },
]
},
{
text: 'Audio',
// collapsed: false,
items: [
{ text: 'Audio Classification', link: 'audio_classification' },
]
},
{
text: 'Time Series',
// collapsed: false,
items: [
{ text: 'LSTM Stock Prediction', link: 'lstm_stock'},
]
},
]
}

// {
// text: '👥 社区',
// // collapsed: false,
// items: [
// { text: '在线支持', link: 'community/online-support'},
// { text: 'Github徽章', link: 'community/github-badge'},
// { text: '论文引用', link: 'community/paper-cite'},
// { text: '贡献代码', link: 'community/contributing-code'},
// { text: '贡献官方文档', link: 'community/contributing-docs'},
// { text: '贡献者', link: 'community/contributor'},
// { text: '关于我们', link: 'community/emotion-machine'},
// ]
// },]
// }

// function sidebarExamples(): DefaultTheme.SidebarItem[] {
// return [{
// text: '入门',
// // collapsed: false,
// items: [
// { text: 'Hello_World', link: 'hello_world' },
// { text: 'MNIST手写体识别', link: 'mnist' },
// ]
// },
// {
// text: '计算机视觉',
// // collapsed: false,
// items: [
// { text: 'FashionMNIST', link: 'fashionmnist' },
// { text: 'Resnet猫狗分类', link: 'cats_dogs_classification' },
// { text: 'Yolo目标检测', link: 'yolo' },
// ]
// },
// {
// text: '自然语言处理',
// // collapsed: false,
// items: [
// { text: 'BERT文本分类', link: 'bert' },
// { text: 'Qwen微调案例', link: 'qwen_finetune' },
// { text: 'LLM预训练', link: 'pretrain_llm' },
// ]
// },
// {
// text: '音频',
// // collapsed: false,
// items: [
// { text: '音频分类', link: 'audio_classification' },
// ]
// },
// {
// text: '时间序列',
// // collapsed: false,
// items: [
// { text: 'LSTM股票预测', link: 'lstm_stock'},
// ]
// },
// ]
// }

// function sidebarAPI(): DefaultTheme.SidebarItem[] {
// return [{
// text: 'CLI',
// // collapsed: false,
// items: [
// { text: 'swanlab watch', link: 'cli-swanlab-watch' },
// { text: 'swanlab login', link: 'cli-swanlab-login' },
// { text: 'swanlab logout', link: 'cli-swanlab-logout' },
// { text: 'swanlab convert', link: 'cli-swanlab-convert' },
// { text: '(内测中) swanlab remote gpu', link: 'cli-swanlab-remote-gpu' },
// { text: '其他', link: 'cli-swanlab-other' },
// ]
// },
// {
// text: 'Python SDK',
// // collapsed: false,
// items: [
// { text: 'init', link: 'py-init' },
// { text: 'log', link: 'py-log' },
// { text: '多媒体数据', items: [
// { text: 'Image', link: 'py-Image' },
// { text: 'Audio', link: 'py-Audio' },
// { text: 'Text', link: 'py-Text' },
// ]},
// { text: 'login', link: 'py-login' },
// { text: 'integration', link: 'py-integration' },
// { text: 'converter', link: 'py-converter' },
// ]
// },]
// }
function sidebarAPI(): DefaultTheme.SidebarItem[] {
return [{
text: 'CLI',
// collapsed: false,
items: [
{ text: 'swanlab watch', link: 'cli-swanlab-watch' },
{ text: 'swanlab login', link: 'cli-swanlab-login' },
{ text: 'swanlab logout', link: 'cli-swanlab-logout' },
{ text: 'swanlab convert', link: 'cli-swanlab-convert' },
{ text: '(Beta) swanlab remote gpu', link: 'cli-swanlab-remote-gpu' },
{ text: 'Other', link: 'cli-swanlab-other' },
]
},
{
text: 'Python SDK',
// collapsed: false,
items: [
{ text: 'init', link: 'py-init' },
{ text: 'log', link: 'py-log' },
{ text: 'Media data', items: [
{ text: 'Image', link: 'py-Image' },
{ text: 'Audio', link: 'py-Audio' },
{ text: 'Text', link: 'py-Text' },
]},
{ text: 'login', link: 'py-login' },
{ text: 'integration', link: 'py-integration' },
{ text: 'converter', link: 'py-converter' },
]
},]
}
13 changes: 13 additions & 0 deletions en/api/api-index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# API Docs

## CLI
- [swanlab watch](/en/api/cli-swanlab-watch.md): Start offline experiment board
- [swanlab login](/en/api/cli-swanlab-login.md): Login to SwanLab
- [swanlab convert](/en/api/cli-swanlab-convert.md): Convert external logs to SwanLab project

## Python SDK
- [init](/en/api/py-init.md)
- [login](/en/api/py-login.md)
- [Image](/en/api/py-Image.md)
- [Audio](/en/api/py-Audio.md)
- [Text](/en/api/py-Text.md)
32 changes: 32 additions & 0 deletions en/api/cli-swanlab-convert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# swanlab convert

```bash
swanlab convert [OPTIONS]
```

| Option | Description |
| --- | --- |
| `-t`, `--type` | Select the conversion type, options include `tensorboard`, `wandb`, default is `tensorboard`. |
| `-p`, `--project` | Set the SwanLab project name for the conversion, default is None. |
| `-w`, `--workspace` | Set the workspace where the SwanLab project is located, default is None. |
| `-l`, `--logdir` | Set the log file save path for the SwanLab project, default is None. |
| `--cloud` | Set whether the SwanLab project logs are uploaded to the cloud, default is True. |
| `--tb-logdir` | Path to the Tensorboard log files (tfevent) to be converted. |
| `--wb-project` | Name of the Wandb project to be converted. |
| `--wb-entity` | Entity where the Wandb project to be converted is located. |
| `--wb-runid` | ID of the Wandb Run to be converted. |

## Introduction

Convert content from other logging tools into SwanLab projects.
Supported tools for conversion include: `Tensorboard`, `Weights & Biases`.

## Usage Examples

### Tensorboard

[Integration - Tensorboard](/en/guide_cloud/integration/integration-tensorboard.md)

### Weights & Biases

[Integration - Weights & Biases](/en/guide_cloud/integration/integration-wandb.md)
37 changes: 37 additions & 0 deletions en/api/cli-swanlab-login.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# swanlab login

``` bash
swanlab login [OPTIONS]
```

| Option | Description |
| --- | --- |
| `--relogin` | Re-login. |

## Introduction

Log in to your SwanLab account to synchronize experiments to the cloud.

After running the following command, if it's your first login, you will be prompted to fill in your [API_KEY](#):

```bash
swanlab login
```

After the first login, the credentials will be saved locally, and you won't need to log in again via `swanlab.login` or `swanlab login`.

## Re-login

If you need to log in with a different account, use the following command:

```bash
swanlab login --relogin
```

This will prompt you to enter a new API Key to re-login.

## Logout

```bash
swanlab logout
```
7 changes: 7 additions & 0 deletions en/api/cli-swanlab-logout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# swanlab

```bash
swanlab logout
```

Logout from the programming environment.
4 changes: 4 additions & 0 deletions en/api/cli-swanlab-other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Other CLI Commands

- `swanlab -v`: Check the version of the SwanLab library.
- `swanlab --help`: API help.
Loading

0 comments on commit d2b268d

Please sign in to comment.