Skip to content

Commit

Permalink
[Model] Add BNB support to Llava and Pixtral-HF (vllm-project#10795)
Browse files Browse the repository at this point in the history
Signed-off-by: Isotr0py <[email protected]>
  • Loading branch information
Isotr0py authored and weilong.yu committed Dec 13, 2024
1 parent 3fac6de commit ce73dfb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions vllm/model_executor/models/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ def init_vision_tower_for_llava(
@INPUT_REGISTRY.register_dummy_data(dummy_data_for_llava)
@INPUT_REGISTRY.register_input_processor(input_processor_for_llava)
class LlavaForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsPP):
# BitandBytes specific attributes
bitsandbytes_stacked_params_mapping = {
# shard_name, weight_name, index
"q_proj": ("qkv_proj", 0),
"k_proj": ("qkv_proj", 1),
"v_proj": ("qkv_proj", 2),
"gate_proj": ("gate_up_proj", 0),
"up_proj": ("gate_up_proj", 1),
}

def __init__(self, *, vllm_config: VllmConfig, prefix: str = "") -> None:
super().__init__()
Expand Down

0 comments on commit ce73dfb

Please sign in to comment.