Update sampler.py to skip the success check (#2197)

This commit is contained in:
Lianmin Zheng
2024-11-26 00:58:57 -08:00
committed by GitHub
parent ac5a0f0488
commit ba4ee37fa4

View File

@@ -74,7 +74,7 @@ class Sampler(nn.Module):
filter_apply_order="joint",
)
if not torch.all(success):
if self.use_nan_detectioin and not torch.all(success):
logger.warning("Detected errors during sampling!")
batch_next_token_ids = torch.zeros_like(batch_next_token_ids)
elif global_server_args_dict["sampling_backend"] == "pytorch":