From 57c9b5a667c38e7b365e23cfd8ff319062538cac Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 14 Sep 2023 11:03:38 -0400 Subject: [PATCH 1/2] mypy wandb ignore --- src/axolotl/utils/callbacks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/axolotl/utils/callbacks.py b/src/axolotl/utils/callbacks.py index 819360f1d..9fdb5af7e 100644 --- a/src/axolotl/utils/callbacks.py +++ b/src/axolotl/utils/callbacks.py @@ -11,7 +11,6 @@ import pandas as pd import torch import torch.distributed as dist -import wandb from datasets import load_dataset from optimum.bettertransformer import BetterTransformer from tqdm import tqdm @@ -25,6 +24,7 @@ ) from transformers.trainer_utils import PREFIX_CHECKPOINT_DIR, IntervalStrategy +import wandb from axolotl.utils.bench import log_gpu_memory_usage from axolotl.utils.distributed import ( barrier, @@ -385,7 +385,7 @@ def find_ranges(lst): return ranges def log_table_from_dataloader(name: str, table_dataloader): - table = wandb.Table( + table = wandb.Table( # type: ignore[attr-defined] columns=[ "id", "Prompt", @@ -506,7 +506,7 @@ def log_table_from_dataloader(name: str, table_dataloader): ) row_index += 1 - wandb.run.log({f"{name} - Predictions vs Ground Truth": table}) + wandb.run.log({f"{name} - Predictions vs Ground Truth": table}) # type: ignore[attr-defined] if is_main_process(): log_table_from_dataloader("Eval", eval_dataloader) From 5150b0a4a0b5355831ca1e2f4a7657f12e5b1843 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 14 Sep 2023 11:07:41 -0400 Subject: [PATCH 2/2] fix isort for wandb --- src/axolotl/utils/callbacks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/axolotl/utils/callbacks.py b/src/axolotl/utils/callbacks.py index 9fdb5af7e..bf8c4145b 100644 --- a/src/axolotl/utils/callbacks.py +++ b/src/axolotl/utils/callbacks.py @@ -11,6 +11,7 @@ import pandas as pd import torch import torch.distributed as dist +import wandb from datasets import load_dataset from optimum.bettertransformer import BetterTransformer from tqdm import tqdm @@ -24,7 +25,6 @@ ) from transformers.trainer_utils import PREFIX_CHECKPOINT_DIR, IntervalStrategy -import wandb from axolotl.utils.bench import log_gpu_memory_usage from axolotl.utils.distributed import ( barrier,