From 4acc8213d2e3e2edf87a9bbbd6ed2c52e09019c6 Mon Sep 17 00:00:00 2001 From: LS Date: Tue, 23 Apr 2024 01:43:21 +0800 Subject: [PATCH] fix: checking the base_model_name_or_path of adapter_config and early return if null (#431) Co-authored-by: LS --- server/lorax_server/utils/adapter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/lorax_server/utils/adapter.py b/server/lorax_server/utils/adapter.py index f4d5bb837..1a4f246fd 100644 --- a/server/lorax_server/utils/adapter.py +++ b/server/lorax_server/utils/adapter.py @@ -86,6 +86,10 @@ def _load_and_merge( def check_architectures(model_id: str, adapter_id: str, adapter_config: "AdapterConfig"): try: + if not adapter_config.base_model_name_or_path: + # Avoid execuation latency caused by the network connection retrying for AutoConfig.from_pretrained(None) + return + expected_config = AutoConfig.from_pretrained(model_id) model_config = AutoConfig.from_pretrained(adapter_config.base_model_name_or_path) except Exception as e: