mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 10:30:37 +08:00
[Bugfix] Fix missing return value in load_weights method of adapters.py (#15542)
Signed-off-by: noc-turne <2270929247@qq.com>
This commit is contained in:
parent
c2e7507ad4
commit
037bcd942c
@ -99,16 +99,17 @@ def _create_pooling_model_cls(
|
|||||||
mapper = WeightsMapper(orig_to_new_prefix={"model.": ""})
|
mapper = WeightsMapper(orig_to_new_prefix={"model.": ""})
|
||||||
weights = mapper.apply(weights)
|
weights = mapper.apply(weights)
|
||||||
|
|
||||||
self.model.load_weights(weights)
|
loaded_params = self.model.load_weights(weights)
|
||||||
return
|
loaded_params = {f"model.{name}" for name in loaded_params}
|
||||||
|
return loaded_params
|
||||||
|
|
||||||
# For most other models
|
# For most other models
|
||||||
if hasattr(orig_cls, "load_weights"):
|
if hasattr(orig_cls, "load_weights"):
|
||||||
orig_cls.load_weights(self, weights) # type: ignore
|
return orig_cls.load_weights(self, weights) # type: ignore
|
||||||
# Fallback
|
# Fallback
|
||||||
else:
|
else:
|
||||||
loader = AutoWeightsLoader(self)
|
loader = AutoWeightsLoader(self)
|
||||||
loader.load_weights(weights)
|
return loader.load_weights(weights)
|
||||||
|
|
||||||
return ModelForPooling # type: ignore
|
return ModelForPooling # type: ignore
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user