The wandb official docs Manage job inputs | Weights & Biases Documentation
state the following to achieve the wandb UI drawer:
schema = {
"type": "object",
"properties": {
"seed": {
"type": "integer"
}
"trainer": {
"type": "object",
"properties": {
"learning_rate": {
"type": "number",
"description": "Learning rate of the model",
"exclusiveMinimum": 0,
},
"batch_size": {
"type": "integer",
"description": "Number of samples per batch",
"enum": [16, 64, 256]
},
"dataset": {
"type": "string",
"description": "Name of the dataset to use",
"enum": ["cifar10", "cifar100"]
}
}
}
}
}
launch.manage_wandb_config(
include=["seed", "trainer"],
exclude=["trainer.private"],
schema=schema,
)
my code looks like:
import wandb
from wandb.sdk import launch
# Required for W&B Launch
wandb.require("core")
# Define JSON schema for W&B Launch (optional to keep the UI drawer fields)
schema = {
"type": "object",
"properties": {
"PreprocessingParams": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Location filter for the S3 file paths (e.g., 'Morocco')",
},
"dataset_channels": {
"type": "number",
"description": "Number of channels in the dataset",
},
"channel_start_leak": {
"type": "number",
"description": "Start channel for leak condition",
},
"channel_end_leak": {
"type": "number",
"description": "End channel for leak condition",
},
"capture_period_leak": {
"type": "object",
"description": "Capture period for leak condition",
"properties": {
"start": {"type": "number"},
"end": {"type": "number"},
},
},
"sampling_rate": {
"type": "number",
"description": "The sampling rate of the data",
},
"channel_start_no_leak": {
"type": "number",
"description": "Start channel for no-leak condition",
},
"channel_end_no_leak": {
"type": "number",
"description": "End channel for no-leak condition",
},
"capture_period_no_leak": {
"type": "object",
"description": "Capture period for no-leak condition",
"properties": {
"start": {"type": "number"},
"end": {"type": "number"},
},
},
"test_size": {
"type": "number",
"description": "Test dataset size (fraction of total dataset)",
},
"random_seed": {
"type": "number",
"description": "Random seed for reproducibility",
},
},
}
},
}
if __name__ == "__main__":
# 1) Let W&B know we have a config file. The "include" argument
# ensures only "PreprocessingParams" is exposed in the Launch UI.
launch.manage_config_file("config.yaml", include=["PreprocessingParams"])
# 2) Read config.yaml (the contents might be patched by Launch if a user overrides them)
with open("config.yaml", "r") as f:
config = yaml.safe_load(f)
# 3) Initialize W&B with config from the file
wandb.login(key="<my-key>")
with wandb.init(
project="leak-detection",
job_type="preprocessing",
config=config,
) as run:
# Optionally attach schema for UI drawer
launch.manage_wandb_config(
include=["PreprocessingParams"],
schema=schema
)
...
yet it doesn’t show the UI drawer but only a raw json format as seen here:
what could be the issue?