Some weights of the model checkpoint at Ray2333/GRM-llama3-8B-sftreg were not used when initializing

#1
by RylanSchaeffer - opened

When I load the model, I receive the warning:

Some weights of the model checkpoint at Ray2333/GRM-llama3-8B-sftreg were not used when initializing LlamaForCausalLM: ['v_head.summary.0.bias', 'v_head.summary.0.weight', 'v_head.summary.2.bias', 'v_head.summary.2.weight']
- This IS expected if you are initializing LlamaForCausalLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing LlamaForCausalLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
/lfs/skampere1/0/rschaef/miniconda3/envs/reward_modeling_20240708/lib/python3.11/site-packages/trl/models/modeling_base.py:331: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  state_dict = loading_func(filename if not use_safe else safe_filename, **load_kwargs)

If I want the default behavior, is this a problem?

Owner

Thanks for your question. The warning you encountered is expected behavior. As detailed in the model.py file ((https://huggingface.co/Ray2333/GRM-llama3-8B-sftreg/blob/main/model.py), the model is loaded twice, and during the first load, the v_head is not utilized, which is the cause of the warning.

The loading example is already tested by me so you can trust it.

RylanSchaeffer changed discussion status to closed

Sign up or log in to comment