@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 037bcd942c
Fork 0

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 15, 17:15 UTC

[Bugfix] Fix missing return value in load_weights method of adapters.py (#15542)

Signed-off-by: noc-turne <2270929247@qq.com>

Mrm committed Mar 31, 2025 at 21:56 UTC 037bcd942cac24a30dfe61ea3423caf62c92a153
1 file changed +5 -4
vllm/model_executor/models/adapters.py
+5 -4
@@ -99,16 +99,17 @@ def _create_pooling_model_cls(
99 mapper = WeightsMapper(orig_to_new_prefix={"model.": ""})
100 weights = mapper.apply(weights)
101
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
105
106 # For most other models
107 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
109 # Fallback
110 else:
111 loader = AutoWeightsLoader(self)
111 - loader.load_weights(weights)
112 + return loader.load_weights(weights)
113
114 return ModelForPooling # type: ignore
115