change code to full string match and print necessary message
change code to full string match and print a short message to inform users that lm_head.weight has been skipped.
This commit is contained in:
parent
0060ccdde6
commit
6d84a42d1e
1 changed files with 3 additions and 2 deletions
|
@ -2279,7 +2279,8 @@ class GemmaModel(Model):
|
||||||
for name, data_torch in self.get_tensors():
|
for name, data_torch in self.get_tensors():
|
||||||
# lm_head is not used in llama.cpp, while autoawq will include this tensor in model
|
# lm_head is not used in llama.cpp, while autoawq will include this tensor in model
|
||||||
# To prevent errors, skip loading lm_head.weight.
|
# To prevent errors, skip loading lm_head.weight.
|
||||||
if "lm_head.weight" in name:
|
if name == "lm_head.weight":
|
||||||
|
print(f"Skipping get tensor {name!r} in safetensors so that convert can end normally.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
old_dtype = data_torch.dtype
|
old_dtype = data_torch.dtype
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue