Skip to content

Commit fc84b1c

Browse files
committed
fix: make wandb imports optional (vLLM 0.22.0 broke wandb proto)
1 parent 0093248 commit fc84b1c

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

nemo_rl/experience/rollout_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919

2020
import torch
2121
from transformers import PreTrainedTokenizerBase
22-
from wandb import Table
22+
try:
23+
from wandb import Table
24+
except ImportError:
25+
Table = None
2326

2427
from nemo_rl.data.interfaces import DatumSpec
2528
from nemo_rl.distributed.batched_data_dict import BatchedDataDict

nemo_rl/experience/rollouts.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
import torch
3131
from pydantic import BaseModel
3232
from transformers import PreTrainedTokenizerBase
33-
from wandb import Histogram, Table
33+
try:
34+
from wandb import Histogram, Table
35+
except ImportError:
36+
Histogram = Table = None
3437

3538
from nemo_rl.data.interfaces import (
3639
DatumSpec,

nemo_rl/utils/logger.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
import requests
3131
import swanlab
3232
import torch
33-
import wandb
33+
try:
34+
import wandb
35+
except ImportError:
36+
wandb = None
3437
from matplotlib import pyplot as plt
3538
from prometheus_client.parser import text_string_to_metric_families
3639
from prometheus_client.samples import Sample

0 commit comments

Comments
 (0)