diff --git a/engines/python/setup/djl_python/huggingface.py b/engines/python/setup/djl_python/huggingface.py index e89ef71c19e..9dce5bd6f93 100644 --- a/engines/python/setup/djl_python/huggingface.py +++ b/engines/python/setup/djl_python/huggingface.py @@ -589,12 +589,18 @@ def _read_model_config(self, model_config_path: str, revision=None): raise e def _fetch_adapters_from_input(self, input_map: dict, input: Input): - adapters = input_map.pop("adapters", []) - if not adapters: - ## check if input contains adapters, possible in workflow approach - if input.contains_key("adapter"): - adapters = input.get_as_string("adapter") - return adapters + if "adapters" in input_map: + return input_map.pop("adapters", []) + + # check content, possible in workflow approach + if input.contains_key("adapter"): + return input.get_as_string("adapter") + + # check properties, possible from header + if "adapter" in input.get_properties(): + return input.get_properties()["adapter"] + + return [] _service = HuggingFaceService()