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
21 changes: 12 additions & 9 deletions swanlab/converter/wb/wb_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ def parse_wandb_logs(self, wb_project: str, wb_entity: str, wb_run_id: str = Non
swanlab_run = swanlab.init(
project=wb_project if self.project is None else self.project,
workspace=self.workspace,
experiment_name=wb_run.name,
description=wb_run.notes,
experiment_name=getattr(wb_run, "name", None),
description=getattr(wb_run, "notes", None),
mode=self.mode,
logdir=self.logdir,
tags=getattr(wb_run, "tags", None),
group=getattr(wb_run, "group", None),
job_type=getattr(wb_run, "job_type", None),
)
else:
swanlab_run = swanlab.get_run()
Expand All @@ -71,17 +74,17 @@ def parse_wandb_logs(self, wb_project: str, wb_entity: str, wb_run_id: str = Non
wb_run_metadata = {}

wb_config = {
"wandb_run_id": wb_run.id,
"wandb_run_name": wb_run.name,
"Created Time": wb_run.created_at,
"wandb_user": wb_run.user,
"wandb_tags": wb_run.tags,
"wandb_url": wb_run.url,
"wandb_run_id": getattr(wb_run, "id", None),
"wandb_run_name": getattr(wb_run, "name", None),
"Created Time": getattr(wb_run, "created_at", None),
"wandb_entity": getattr(wb_run, "entity", None),
"wandb_tags": getattr(wb_run, "tags", None),
"wandb_url": getattr(wb_run, "url", None),
}
wb_config.update(wb_run_metadata)

swanlab_run.config.update(wb_config)
swanlab_run.config.update(wb_run.config)
swanlab_run.config.update(getattr(wb_run, "config", {}))

# Get the first history record to extract available keys
history = wb_run.history(stream="default")
Expand Down
6 changes: 4 additions & 2 deletions swanlab/sync/wandb.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def sync_wandb(
original_config_update = wandb_sdk.wandb_config.Config.update

def patched_init(*args, **kwargs):
entity, project, dir, id, name, notes, tags, config, config_exclude_keys, reinit = _extract_args(
args, kwargs, ['entity', 'project', 'dir', 'id', 'name', 'notes', 'tags', 'config', 'config_exclude_keys', 'reinit']
entity, project, dir, id, name, notes, tags, config, config_exclude_keys, reinit, group, job_type = _extract_args(
args, kwargs, ['entity', 'project', 'dir', 'id', 'name', 'notes', 'tags', 'config', 'config_exclude_keys', 'reinit', 'group', 'job_type']
)

if swanlab.data.get_run() is None:
Expand All @@ -86,6 +86,8 @@ def patched_init(*args, **kwargs):
mode=mode,
logdir=logdir,
reinit=reinit,
group=group,
job_type=job_type,
)
else:
swanlab.config.update(config)
Expand Down