A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 07:00 UTC
[Pixtral-Large] Pixtral actually has no bias in vision-lang adapter (#10449)
Patrick von Platen committed
Nov 19, 2024 at 18:33 UTC
11fd7ea639cf3c4fae29322d8e5c839ff6f8a1ca
1 file changed
+3
-2
vllm/model_executor/models/pixtral.py
+3
-2
@@ -331,6 +331,7 @@ class VisionEncoderArgs:
331
num_attention_heads: int
332
rope_theta: float # for rope-2D
333
image_token_id: int
334
+ adapter_bias: bool = True
335
336
337
def _reshape_for_broadcast(freqs_cis: torch.Tensor,
@@ -595,10 +596,10 @@ class VisionLanguageAdapter(nn.Module):
596
self.w_in = nn.Linear(
597
args.hidden_size,
598
dim,
598
- bias=True,
599
+ bias=args.adapter_bias,
600
)
601
self.gelu = nn.GELU()
601
- self.w_out = nn.Linear(dim, dim, bias=True)
602
+ self.w_out = nn.Linear(dim, dim, bias=args.adapter_bias)
603
604
def forward(self, x: torch.Tensor) -> torch.Tensor:
605
return self.w_out(self.gelu(self.w_in(x)))