File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
vllm/model_executor/models Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ def apply(self, key: str) -> Optional[str]:
57
57
58
58
class AutoWeightsLoader :
59
59
"""
60
- Helper class to load weights into a :class:`torch.nn.Module`.
60
+ Helper class to load weights into a :class:`torch.nn.Module`. It is able
61
+ to automatically detect child modules and parameters while iterating over
62
+ the weights only once.
61
63
62
64
The weight loading logic for individual modules can be overridden
63
65
by defining a ``load_weights`` method.
@@ -144,7 +146,8 @@ def _groupby_prefix(
144
146
key = lambda x : x [0 ][0 ]):
145
147
yield (
146
148
prefix ,
147
- # Because maxsplit=1, the length of `rest` can either be 0 or 1
149
+ # Because maxsplit=1 in weight_name.split(...),
150
+ # the length of `rest` must either be 0 or 1
148
151
(("" if len (rest ) == 0 else rest [0 ], weights_data )
149
152
for (_ , * rest ), weights_data in group ),
150
153
)
You can’t perform that action at this time.
0 commit comments