File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
vllm/v1/attention/backends Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -638,11 +638,15 @@ def __init__(
638
638
639
639
self .sinks : Optional [torch .Tensor ] = None
640
640
if sinks is not None :
641
- assert sinks .shape [0 ] == num_heads , (
642
- "Sinks must have the same number of heads "
643
- "as the number of heads in the layer"
644
- )
645
- assert sinks .dtype == torch .float32 , "Sinks must be of type float32"
641
+ if sinks .shape [0 ] != num_heads :
642
+ raise ValueError (
643
+ "Sinks must have the same number of heads as the number of "
644
+ f"heads in the layer. Expected { num_heads } , but got "
645
+ f"{ sinks .shape [0 ]} ."
646
+ )
647
+ if sinks .dtype != torch .float32 :
648
+ raise ValueError ("Sinks must be of type float32, but got "
649
+ f"{ sinks .dtype } ." )
646
650
self .sinks = sinks
647
651
648
652
def forward (
You can’t perform that action at this time.
0 commit comments