"lm_head.weight" missing when loading (possible incomplete weights?)
#5
by
enfly903 - opened
I’m seeing a weight-loading issue for this model and wanted to check whether the uploaded weights are incomplete or if I’m loading it incorrectly.
Load the model with "transformers==5.0.0" without missing-key warnings/errors, and run text generation normally.
When loading, I get a message about missing weights:
- Missing key: "lm_head.weight" (and possibly related keys)
from transformers import AutoProcessor, AutoModelForImageTextToText, AutoModelForCausalLM
model_id = "LiquidAI/LFM2.5-VL-1.6B"
model = AutoModelForImageTextToText.from_pretrained(
model_id,
device_map="auto",
dtype="bfloat16"
)
Questions
- Is "lm_head.weight" expected to be missing for this model (tied embeddings), or should it be present in the repo weights?
- If it should be present, could there be a missing shard / incorrect upload / conversion issue?
- If this is expected, what is the recommended way to load so it ties embeddings correctly and avoids missing-key warnings?
Thanks for taking a look.
I was getting the same message and was having trouble with images,
i installed the specific transformers version in the model card:
pip install git+https://github.com/huggingface/transformers.git@3c2517727ce28a30f5044e01663ee204deb1cdbe
it is all good now
enfly903 changed discussion status to
closed
If you want to try with transformers v5, you can use this commit 2a5ba8b53d298ed8421e09831bf96bb6d056a24d