fix: improve logging and rebase syntax issue

This commit is contained in:
drbh 2024-07-15 20:40:39 +00:00
parent 5ec88a1b51
commit d27131bfa8

View File

@ -81,22 +81,19 @@ def serve(
if otlp_endpoint is not None: if otlp_endpoint is not None:
setup_tracing(otlp_service_name=otlp_service_name, otlp_endpoint=otlp_endpoint) setup_tracing(otlp_service_name=otlp_service_name, otlp_endpoint=otlp_endpoint)
lora_adapters = parse_lora_adapters(os.environ.get("LORA_ADAPTERS", None)) lora_adapters = parse_lora_adapters(os.getenv("LORA_ADAPTERS"))
if len(lora_adapters) > 0:
logger.warning(
f"LoRA adapters are enabled. This is an experimental feature and may not work as expected."
)
# TODO: enable lora with cuda graphs. for now disable cuda graphs if lora is enabled # TODO: enable lora with cuda graphs. for now disable cuda graphs if lora is enabled
# and warn the user # and warn the user
if len(lora_adapters) > 0 and os.getenv("CUDA_GRAPHS", None) is not None: if lora_adapters:
log_master( logger.warning("LoRA adapters enabled (experimental feature).")
logger.warning,
f"LoRa adapter are not supported with CUDA Graphs. Disabling CUDA Graphs.", if "CUDA_GRAPHS" in os.environ:
) logger.warning(
global CUDA_GRAPHS "LoRA adapters incompatible with CUDA Graphs. Disabling CUDA Graphs."
CUDA_GRAPHS = None )
global CUDA_GRAPHS
CUDA_GRAPHS = None
# Downgrade enum into str for easier management later on # Downgrade enum into str for easier management later on
quantize = None if quantize is None else quantize.value quantize = None if quantize is None else quantize.value