From 607406b1aaff11529dbfdadf4e8eeb5d8a084530 Mon Sep 17 00:00:00 2001 From: Yaoming Mu Date: Fri, 23 Feb 2024 05:08:57 -0800 Subject: [PATCH] fix bug causing the following RuntimeError when call apply_weights with bias tensor vllm/model_executor/layers/linear.py", line 70, in apply_weights if bias: RuntimeError: Boolean value of Tensor with more than one value is ambiguous --- vllm/model_executor/layers/linear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/model_executor/layers/linear.py b/vllm/model_executor/layers/linear.py index 024a39523f48a..d070478afd6d0 100644 --- a/vllm/model_executor/layers/linear.py +++ b/vllm/model_executor/layers/linear.py @@ -67,7 +67,7 @@ def apply_weights(self, bias: Optional[torch.Tensor] = None) -> torch.Tensor: weight = weights["weight"] #if self.separate_bias_add: - if bias: + if bias != None : return tgemm.mm(x, weight) + bias return tgemm.mm(x, weight) #return F.linear(x, weight, bias)