diff --git a/python/sglang/srt/managers/controller/tp_worker.py b/python/sglang/srt/managers/controller/tp_worker.py index 9b223263b6..30e209b228 100644 --- a/python/sglang/srt/managers/controller/tp_worker.py +++ b/python/sglang/srt/managers/controller/tp_worker.py @@ -101,8 +101,7 @@ def __init__( self.int_token_logit_bias = torch.tensor( get_int_token_logit_bias(self.tokenizer, self.model_config.vocab_size) ) - if server_args.random_seed is not None: - set_random_seed(server_args.random_seed) + set_random_seed(server_args.random_seed) # Print info logger.info( diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index b733a3f782..35cc024112 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -32,7 +32,7 @@ class ServerArgs: # Other runtime options tp_size: int = 1 stream_interval: int = 8 - random_seed: Optional[int] = None + random_seed: int = 42 # Logging log_level: str = "info" @@ -194,7 +194,7 @@ def add_cli_args(parser: argparse.ArgumentParser): "--random-seed", type=int, default=ServerArgs.random_seed, - help="The global random seed of the server.", + help="Random seed.", ) parser.add_argument( "--log-level",