"container/vscode:/vscode.git/clone" did not exist on "2e3d4a924ae6d12561531f0fbc51f3b8063fc749"
Unverified Commit 037bcd94 authored by Mrm's avatar Mrm Committed by GitHub
Browse files

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


Signed-off-by: default avatarnoc-turne <2270929247@qq.com>
parent c2e7507a
......@@ -99,16 +99,17 @@ def _create_pooling_model_cls(
mapper = WeightsMapper(orig_to_new_prefix={"model.": ""})
weights = mapper.apply(weights)
self.model.load_weights(weights)
return
loaded_params = self.model.load_weights(weights)
loaded_params = {f"model.{name}" for name in loaded_params}
return loaded_params
# For most other models
if hasattr(orig_cls, "load_weights"):
orig_cls.load_weights(self, weights) # type: ignore
return orig_cls.load_weights(self, weights) # type: ignore
# Fallback
else:
loader = AutoWeightsLoader(self)
loader.load_weights(weights)
return loader.load_weights(weights)
return ModelForPooling # type: ignore
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment