move environ into sglang.srt to avoid break SRT auto sync. (#10791)
This commit is contained in:
@@ -10,7 +10,7 @@ from sglang.srt.utils import kill_process_tree
|
||||
MOVE_ENVS_WARN = """
|
||||
########################################################################
|
||||
# For contributors and developers: #
|
||||
# Please move environment variable definitions to 'sglang/environ.py' #
|
||||
# Please move environment variable definitions to sglang.srt.environ #
|
||||
# using the following pattern: #
|
||||
# SGLANG_XXX = EnvBool(False) #
|
||||
# #
|
||||
|
||||
@@ -12,8 +12,8 @@ import torch.nn.functional as F
|
||||
import triton
|
||||
import triton.language as tl
|
||||
|
||||
from sglang.environ import envs
|
||||
from sglang.srt.constrained.base_grammar_backend import BaseGrammarObject
|
||||
from sglang.srt.environ import envs
|
||||
from sglang.srt.layers.attention.utils import create_flashinfer_kv_indices_triton
|
||||
from sglang.srt.layers.logits_processor import LogitsProcessorOutput
|
||||
from sglang.srt.layers.sampler import apply_custom_logit_processor
|
||||
|
||||
@@ -195,7 +195,7 @@ _warned_bool_env_var_keys = set()
|
||||
|
||||
|
||||
def get_bool_env_var(name: str, default: str = "false") -> bool:
|
||||
# FIXME: move your environment variable to sglang.environ
|
||||
# FIXME: move your environment variable to sglang.srt.environ
|
||||
value = os.getenv(name, default)
|
||||
value = value.lower()
|
||||
|
||||
@@ -213,7 +213,7 @@ def get_bool_env_var(name: str, default: str = "false") -> bool:
|
||||
|
||||
|
||||
def get_int_env_var(name: str, default: int = 0) -> int:
|
||||
# FIXME: move your environment variable to sglang.environ
|
||||
# FIXME: move your environment variable to sglang.srt.environ
|
||||
value = os.getenv(name)
|
||||
if value is None or not value.strip():
|
||||
return default
|
||||
|
||||
Reference in New Issue
Block a user