Commit a1eba087 authored by zhuwenwen's avatar zhuwenwen
Browse files

fix weights_not_loaded

parent e74c54bc
...@@ -313,7 +313,8 @@ class DefaultModelLoader(BaseModelLoader): ...@@ -313,7 +313,8 @@ class DefaultModelLoader(BaseModelLoader):
# We only enable strict check for non-quantized models # We only enable strict check for non-quantized models
# that have loaded weights tracking currently. # that have loaded weights tracking currently.
if model_config.quantization is None and loaded_weights is not None: if model_config.quantization is None and loaded_weights is not None:
# weights_not_loaded = {k for k in weights_not_loaded if not k.endswith("indexer.weights_proj.bias")} weights_not_loaded = weights_to_load - loaded_weights
weights_not_loaded = {k for k in weights_not_loaded if not k.endswith("indexer.weights_proj.bias")}
if weights_not_loaded: if weights_not_loaded:
raise ValueError( raise ValueError(
"Following weights were not initialized from " "Following weights were not initialized from "
......
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