Skip to content

Commit

Permalink
Merge pull request karpathy#20 from lantiga/wandb-optional-import
Browse files Browse the repository at this point in the history
Make wandb import conditioned to wandb_log=True
  • Loading branch information
karpathy authored Jan 8, 2023
2 parents e53b9d2 + 09f1f45 commit e7cd674
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Dependencies:
- `pip install tiktoken` for OpenAI's fast BPE code <3
- `pip install wandb` for optional logging <3
- `pip install tqdm`
- `pip install networkx`

## usage

Expand Down
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import time
import math

import wandb
import numpy as np
import torch
from torch.nn.parallel import DistributedDataParallel as DDP
Expand Down Expand Up @@ -180,6 +179,7 @@ def get_lr(iter):

# logging
if wandb_log and gpu_id == 0:
import wandb
wandb.init(project=wandb_project, name=wandb_run_name)
wandb.config = {
"batch_size": batch_size,
Expand Down

0 comments on commit e7cd674

Please sign in to comment.