[diffusion] fix: remove multimodal_gen redundant get_bool_env_var func (#13583)

Co-authored-by: Mick <mickjagger19@icloud.com>
This commit is contained in:
joesun
2025-11-20 14:05:29 +08:00
committed by GitHub
parent 10e0b83a4c
commit c7b37b7074

View File

@@ -308,30 +308,6 @@ def set_cuda_arch():
os.environ["TORCH_CUDA_ARCH_LIST"] = f"{arch}{'+PTX' if arch == '9.0' else ''}"
def get_bool_env_var(env_var_name: str, default: str | bool = "false") -> bool:
raw_value = os.getenv(env_var_name, None)
if raw_value is None:
raw_value = str(default)
value_str = str(raw_value).strip().lower()
truthy = {"1", "true", "yes", "y", "t", "on"}
falsy = {"0", "false", "no", "n", "f", "off", ""}
if value_str in truthy:
return True
if value_str in falsy:
return False
default_bool = str(default).strip().lower() in truthy
logger.warning(
"Unrecognized boolean for %s=%r; falling back to default=%r",
env_var_name,
raw_value,
default_bool,
)
return default_bool
def is_flashinfer_available():
"""
Check whether flashinfer is available.
@@ -348,12 +324,11 @@ _warned_bool_env_var_keys = set()
def get_bool_env_var(name: str, default: str = "false") -> bool:
# FIXME: move your environment variable to sglang.srt.environ
value = os.getenv(name, default)
value = value.lower()
value = str(value).strip().lower()
truthy_values = ("true", "1")
falsy_values = ("false", "0")
truthy_values = {"1", "true", "yes", "y", "t", "on"}
falsy_values = {"0", "false", "no", "n", "f", "off", ""}
if (value not in truthy_values) and (value not in falsy_values):
if value not in _warned_bool_env_var_keys: