Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python][fix] check whether config has enable_lora attribute #2616

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion engines/python/setup/djl_python/input_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ def add_server_maintained_params(request_input: RequestInput,

def parse_adapters(request_input: TextInput, input_item: Input,
input_map: Dict, **kwargs):
if kwargs.get("configs").enable_lora:
configs = kwargs.get("configs")
if hasattr(configs, "enable_lora") and configs.enable_lora:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if hasattr(configs, "enable_lora") and configs.enable_lora:
if getattr(configs, "enable_lora", False):

adapter_registry = kwargs.get("adapter_registry")
input_len = len(request_input.input_text) if isinstance(
request_input.input_text, list) else 1
Expand Down
Loading