mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-10 20:04:52 +00:00
Fix Falcon weight mapping for H2O.ai checkpoints
During the safetensor conversion, duplicate weights are removed. However, which of the duplicates gets removed, differs per checkpoint. In some, like `h2oai/h2ogpt-oig-oasst1-falcon-40b`, the weight `transformer.word_embeddings.weightSafetensor` gets removed. In others, `lm_head.weight` gets removed. Long story long, we need to support both. Originally,f018143
mapped `lm_head` to `word_embeddings`. Thenac736fd
switched this around. This commit merges them and allows for both.
This commit is contained in:
parent
7c2e0af2a6
commit
e864b95656
@ -54,7 +54,10 @@ class FlashRWSharded(FlashCausalLM):
|
||||
device,
|
||||
dtype,
|
||||
process_group=self.process_group,
|
||||
aliases={"lm_head.weight": ["transformer.word_embeddings.weight"]},
|
||||
aliases={
|
||||
"lm_head.weight": ["transformer.word_embeddings.weight"],
|
||||
"transformer.word_embeddings.weight": ["lm_head.weight"],
|
||||
},
|
||||
)
|
||||
|
||||
config.quantize = quantize
|
||||
|
Loading…
Reference in New Issue
Block a user