Skip to content

Commit 037bcd9

Browse files
authored
[Bugfix] Fix missing return value in load_weights method of adapters.py (vllm-project#15542)
Signed-off-by: noc-turne <2270929247@qq.com>
1 parent c2e7507 commit 037bcd9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

vllm/model_executor/models/adapters.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,17 @@ def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]):
9999
mapper = WeightsMapper(orig_to_new_prefix={"model.": ""})
100100
weights = mapper.apply(weights)
101101

102-
self.model.load_weights(weights)
103-
return
102+
loaded_params = self.model.load_weights(weights)
103+
loaded_params = {f"model.{name}" for name in loaded_params}
104+
return loaded_params
104105

105106
# For most other models
106107
if hasattr(orig_cls, "load_weights"):
107-
orig_cls.load_weights(self, weights) # type: ignore
108+
return orig_cls.load_weights(self, weights) # type: ignore
108109
# Fallback
109110
else:
110111
loader = AutoWeightsLoader(self)
111-
loader.load_weights(weights)
112+
return loader.load_weights(weights)
112113

113114
return ModelForPooling # type: ignore
114115

0 commit comments

Comments
 (0)