From a3dede7316395a3e13d36961acc27cc598827ddc Mon Sep 17 00:00:00 2001 From: ApostaC Date: Thu, 12 Dec 2024 21:11:33 -0600 Subject: [PATCH] use from_env to initialize the configuration --- lmcache_vllm/vllm_adapter.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lmcache_vllm/vllm_adapter.py b/lmcache_vllm/vllm_adapter.py index f2e81e3..80489a0 100644 --- a/lmcache_vllm/vllm_adapter.py +++ b/lmcache_vllm/vllm_adapter.py @@ -110,14 +110,11 @@ def lmcache_get_config() -> LMCacheEngineConfig: return lmcache_get_config.cached_config if "LMCACHE_CONFIG_FILE" not in os.environ: - logger.warn("No LMCache configuration file is set. Returning default config") - logger.warn("Please set the configuration file through " + logger.warn("No LMCache configuration file is set. Trying to read" + " configurations from the environment variables.") + logger.warn("You can set the configuration file through " "the environment variable: LMCACHE_CONFIG_FILE") - config = LMCacheEngineConfig.from_defaults( - local_device = "cpu", - remote_url = None, - remote_serde = None, - pipelined_backend = False) + config = LMCacheEngineConfig.from_env() else: config_file = os.environ["LMCACHE_CONFIG_FILE"] logger.info(f"Loading LMCache config file {config_file}")