Skip to content

Commit

Permalink
Debug example code for MegaForCausalLM
Browse files Browse the repository at this point in the history
set ignore_mismatched_sizes=True in model loading code
  • Loading branch information
Tylersuard committed May 20, 2023
1 parent 9728f11 commit 219ebcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/mega/modeling_mega.py
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ def forward(
>>> config = AutoConfig.from_pretrained("mnaylor/mega-base-wikitext")
>>> config.is_decoder = True
>>> config.bidirectional = False
>>> model = MegaForCausalLM.from_pretrained("mnaylor/mega-base-wikitext", config=config)
>>> model = MegaForCausalLM.from_pretrained("mnaylor/mega-base-wikitext", config=config, ignore_mismatched_sizes=True)
>>> inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
>>> outputs = model(**inputs)
Expand Down

0 comments on commit 219ebcc

Please sign in to comment.