-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Open
Labels
Description
System Info
transformersversion: 4.57.3- Platform: Linux-5.4.0-169-generic-x86_64-with-glibc2.35
- Python version: 3.12.9
- Huggingface_hub version: 0.36.0
- Safetensors version: 0.5.3
- Accelerate version: 1.11.0
- Accelerate config: not found
- DeepSpeed version: 0.17.5
- PyTorch version (accelerator?): 2.9.0+cu128 (CUDA)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?:
- Using GPU in script?:
- GPU type: NVIDIA A100-SXM4-80GB
Who can help?
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
I found that the lm_head is not loaded correctly for opt-125m while llama3.2 1B is fine.
import transformers
import torch
model = transformers.AutoModelForCausalLM.from_pretrained("facebook/opt-125m", torch_dtype=torch.float16, use_safetensors=True)
>>> print(model.lm_head.weight)
Parameter containing:
tensor(..., device='meta', size=(50272, 768), dtype=torch.bfloat16,
requires_grad=True)Expected behavior
Expecting weights are loaded correctly.