fix dbrx & opt model prefix bug (#2201)

* Update idefics_causal_lm.py

Fix syntax issues

* fix dbrx & opt model prefix bug
This commit is contained in:
icyboy™ 2024-07-08 15:01:14 +08:00 committed by GitHub
parent 05c094fcfa
commit 521d0d990f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -711,7 +711,7 @@ class FlashDbrxForCausalLM(torch.nn.Module):
else:
prefix = f"{prefix}.transformer"
self.model = DbrxModel(config, weights)
self.model = DbrxModel(prefix, config, weights)
self.lm_head = SpeculativeHead.load(
config,
prefix="lm_head",

View File

@ -757,7 +757,7 @@ class OPTForCausalLM(OPTPreTrainedModel):
else:
prefix = f"{prefix}.model"
self.model = OPTModel(config, weights)
self.model = OPTModel(prefix, config, weights)
self.lm_head = SpeculativeHead.load(
config, prefix=f"{prefix}.decoder.embed_tokens", weights=weights