Skip to content

Commit c7aa37c

Browse files
committed
[SW-195525] INC Logger: Support ENABLE_CONSOLE values 1/0
Add support for values '1' and '0' for 'ENABLE_CONSOLE' env var Change-Id: I53f71250d7a74d2a8050aa1722b75acaebef0c4c
1 parent b42b018 commit c7aa37c

File tree

1 file changed

+3
-3
lines changed
  • neural_compressor/torch/algorithms/fp8_quant/utils

1 file changed

+3
-3
lines changed

neural_compressor/torch/algorithms/fp8_quant/utils/logger.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ def __new__(cls):
103103

104104
def get_enable_console_val(self):
105105
enableConsole = os.environ.get("ENABLE_CONSOLE", "False").upper()
106-
if enableConsole not in ["TRUE", "FALSE"]:
107-
raise Exception("Env var 'ENABLE_CONSOLE' has to be true or false.")
108-
return enableConsole == "TRUE"
106+
if enableConsole not in ["TRUE", "FALSE", "1", "0"]:
107+
raise Exception("Env var 'ENABLE_CONSOLE' has to be 'true' or 'false' ('1' or '0' respectively).")
108+
return enableConsole == "TRUE" or enableConsole == "1"
109109

110110
def get_log_level(self):
111111
log_level_str = os.environ.get("LOG_LEVEL_HQT", os.environ.get("LOG_LEVEL_ALL"))

0 commit comments

Comments
 (0)