Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions areal/api/cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,13 @@ def __post_init__(self):
class WandBConfig:
"""Configuration for Weights & Biases experiment tracking."""

mode: str = "disabled"
mode: str = field(
default="disabled",
metadata={
"help": "Tracking mode. One of 'online', 'offline', 'disabled', or 'shared'.",
"choices": ["online", "offline", "disabled", "shared"],
},
)
wandb_base_url: str = ""
wandb_api_key: str = ""
entity: str | None = None
Expand All @@ -1981,6 +1987,14 @@ class WandBConfig:
config: dict | None = None
id_suffix: str | None = "train"

def __post_init__(self):
"""Validate WandB configuration."""
valid_modes = ("online", "offline", "disabled", "shared")
if self.mode not in valid_modes:
raise ValueError(
f"Invalid wandb mode: '{self.mode}'. Must be one of: {', '.join(valid_modes)}."
)
Comment thread
guozhihao-224 marked this conversation as resolved.


@dataclass
class SwanlabConfig:
Expand All @@ -1990,11 +2004,23 @@ class SwanlabConfig:
name: str | None = None
config: dict | None = None
logdir: str | None = None
mode: str | None = "disabled"
mode: str = field(
default="disabled",
metadata={
"help": "Tracking mode. One of 'cloud', 'local', 'disabled', or 'offline'.",
"choices": ["cloud", "local", "disabled", "offline"],
},
)
# set None to prevent info-leak in docs
api_key: str | None = None

def __post_init__(self):
"""Validate SwanLab configuration."""
valid_modes = ("cloud", "local", "disabled", "offline")
if self.mode not in valid_modes:
raise ValueError(
f"Invalid swanlab mode: '{self.mode}'. Must be one of: {', '.join(valid_modes)}."
)
Comment thread
guozhihao-224 marked this conversation as resolved.
if self.api_key is None:
self.api_key = os.getenv("SWANLAB_API_KEY")

Expand Down
44 changes: 22 additions & 22 deletions docs/en/cli_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -759,14 +759,14 @@ Configuration for experiment statistics logging and tracking services.

Configuration for SwanLab experiment tracking and monitoring.

| Parameter | Type | Default | Description |
| --------- | -------------- | ------------ | ----------- |
| `project` | string \| None | `None` | - |
| `name` | string \| None | `None` | - |
| `config` | `dict` \| None | `None` | - |
| `logdir` | string \| None | `None` | - |
| `mode` | string \| None | `"disabled"` | - |
| `api_key` | string \| None | `None` | - |
| Parameter | Type | Default | Description |
| --------- | -------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `project` | string \| None | `None` | - |
| `name` | string \| None | `None` | - |
| `config` | `dict` \| None | `None` | - |
| `logdir` | string \| None | `None` | - |
| `mode` | string | `"disabled"` | Tracking mode. One of 'cloud', 'local', 'disabled', or 'offline'. **Choices:** `cloud`, `local`, `disabled`, `offline` |
| `api_key` | string \| None | `None` | - |

(section-tensor-board)=

Expand Down Expand Up @@ -805,20 +805,20 @@ See: https://github.com/gradio-app/trackio

Configuration for Weights & Biases experiment tracking.

| Parameter | Type | Default | Description |
| ---------------- | ---------------------- | ------------ | ----------- |
| `mode` | string | `"disabled"` | - |
| `wandb_base_url` | string | `""` | - |
| `wandb_api_key` | string | `""` | - |
| `entity` | string \| None | `None` | - |
| `project` | string \| None | `None` | - |
| `name` | string \| None | `None` | - |
| `job_type` | string \| None | `None` | - |
| `group` | string \| None | `None` | - |
| `notes` | string \| None | `None` | - |
| `tags` | list of string \| None | `None` | - |
| `config` | `dict` \| None | `None` | - |
| `id_suffix` | string \| None | `"train"` | - |
| Parameter | Type | Default | Description |
| ---------------- | ---------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------- |
| `mode` | string | `"disabled"` | Tracking mode. One of 'online', 'offline', 'disabled', or 'shared'. **Choices:** `online`, `offline`, `disabled`, `shared` |
| `wandb_base_url` | string | `""` | - |
| `wandb_api_key` | string | `""` | - |
| `entity` | string \| None | `None` | - |
| `project` | string \| None | `None` | - |
| `name` | string \| None | `None` | - |
| `job_type` | string \| None | `None` | - |
| `group` | string \| None | `None` | - |
| `notes` | string \| None | `None` | - |
| `tags` | list of string \| None | `None` | - |
| `config` | `dict` \| None | `None` | - |
| `id_suffix` | string \| None | `"train"` | - |

(section-archon-engine)=

Expand Down
44 changes: 22 additions & 22 deletions docs/zh/cli_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -757,14 +757,14 @@ Configuration for experiment statistics logging and tracking services.

Configuration for SwanLab experiment tracking and monitoring.

| Parameter | Type | Default | Description |
| --------- | -------------- | ------------ | ----------- |
| `project` | string \| None | `None` | - |
| `name` | string \| None | `None` | - |
| `config` | `dict` \| None | `None` | - |
| `logdir` | string \| None | `None` | - |
| `mode` | string \| None | `"disabled"` | - |
| `api_key` | string \| None | `None` | - |
| Parameter | Type | Default | Description |
| --------- | -------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `project` | string \| None | `None` | - |
| `name` | string \| None | `None` | - |
| `config` | `dict` \| None | `None` | - |
| `logdir` | string \| None | `None` | - |
| `mode` | string | `"disabled"` | Tracking mode. One of 'cloud', 'local', 'disabled', or 'offline'. **Choices:** `cloud`, `local`, `disabled`, `offline` |
| `api_key` | string \| None | `None` | - |

(section-tensor-board)=

Expand Down Expand Up @@ -803,20 +803,20 @@ See: https://github.com/gradio-app/trackio

Configuration for Weights & Biases experiment tracking.

| Parameter | Type | Default | Description |
| ---------------- | ---------------------- | ------------ | ----------- |
| `mode` | string | `"disabled"` | - |
| `wandb_base_url` | string | `""` | - |
| `wandb_api_key` | string | `""` | - |
| `entity` | string \| None | `None` | - |
| `project` | string \| None | `None` | - |
| `name` | string \| None | `None` | - |
| `job_type` | string \| None | `None` | - |
| `group` | string \| None | `None` | - |
| `notes` | string \| None | `None` | - |
| `tags` | list of string \| None | `None` | - |
| `config` | `dict` \| None | `None` | - |
| `id_suffix` | string \| None | `"train"` | - |
| Parameter | Type | Default | Description |
| ---------------- | ---------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------- |
| `mode` | string | `"disabled"` | Tracking mode. One of 'online', 'offline', 'disabled', or 'shared'. **Choices:** `online`, `offline`, `disabled`, `shared` |
| `wandb_base_url` | string | `""` | - |
| `wandb_api_key` | string | `""` | - |
| `entity` | string \| None | `None` | - |
| `project` | string \| None | `None` | - |
| `name` | string \| None | `None` | - |
| `job_type` | string \| None | `None` | - |
| `group` | string \| None | `None` | - |
| `notes` | string \| None | `None` | - |
| `tags` | list of string \| None | `None` | - |
| `config` | `dict` \| None | `None` | - |
| `id_suffix` | string \| None | `"train"` | - |

(section-archon-engine)=

Expand Down
Loading