Skip to content

Commit 6cb13c7

Browse files
authored
[Metrics] Allow getting wandb project name via WANDB_PROJECT (#888)
This commit 1. Move the `tensorboard` imports into class so that it will not raise errors if `tensorboard` not installed. 2. Allow users to obtain `wandb` project name from the env variable `WANDB_PROJECT`, which is defined in their docs.
1 parent 87f7064 commit 6cb13c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchtitan/tools/metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __init__(self, log_dir: str, tag: Optional[str] = None):
137137
os.makedirs(log_dir, exist_ok=True)
138138

139139
self.wandb.init(
140-
project="torchtitan",
140+
project=os.getenv("WANDB_PROJECT", "torchtitan"),
141141
dir=log_dir,
142142
)
143143
logger.info("WandB logging enabled")

0 commit comments

Comments
 (0)