Skip to content

Commit

Permalink
fix: checking the base_model_name_or_path of adapter_config and early…
Browse files Browse the repository at this point in the history
… return if null (#431)

Co-authored-by: LS <LS>
  • Loading branch information
thincal authored Apr 22, 2024
1 parent 8060fe3 commit 4acc821
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/lorax_server/utils/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4acc821

Please sign in to comment.