Skip to content

Commit

Permalink
[lora] Parse adapters iff enable_lora is true (#2603)
Browse files Browse the repository at this point in the history
  • Loading branch information
xyang16 authored Nov 22, 2024
1 parent e27d95f commit 817c2b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions engines/python/setup/djl_python/input_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,8 @@ def add_server_maintained_params(request_input: RequestInput,

def parse_adapters(request_input: TextInput, input_item: Input,
input_map: Dict, **kwargs):
adapter_registry = kwargs.get("adapter_registry")
# if adapter registry exists and not empty, then we assume, peft is supported for the incoming
if adapter_registry:
if kwargs.get("configs").enable_lora:
adapter_registry = kwargs.get("adapter_registry")
input_len = len(request_input.input_text) if isinstance(
request_input.input_text, list) else 1
adapters_data = _fetch_adapters_from_input(input_map, input_item,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Properties(BaseModel):
mpi_mode: bool = False
tgi_compat: Optional[bool] = False
bedrock_compat: Optional[bool] = False
enable_lora: Optional[bool] = False

# Spec_dec
draft_model_id: Optional[str] = None
Expand Down

0 comments on commit 817c2b9

Please sign in to comment.