"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "663b5adaf2ea5ce94838eb9bc8191811e7f5d14b"
Unverified Commit 6397b7f0 authored by Tyler's avatar Tyler Committed by GitHub
Browse files

Debug example code for MegaForCausalLM (#23382)

* Debug example code for MegaForCausalLM

set ignore_mismatched_sizes=True in model loading code

* Fix up
parent 3658488f
......@@ -1743,7 +1743,9 @@ class MegaForCausalLM(MegaPreTrainedModel):
>>> 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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment